I want the to add an item to the pointshop, a rank. When somebody uses it, it will add them to a ulx group called trusted. How would i do that? The pointshop that i use is: Rx Pointshop skin V2
Use ITEM:OnBuy(ply) and ULX's method of changing player rank (which I personally do not know)
would it need a then or anything or just something like this(IK THIS WILL NOT WORK):
[lua] ITEM:OnBuy(ply) RunConsolecommand[[ulx adduser .. trusted]][/lua]
[CODE]function ITEM.OnBuy( ply )
local plname = ply:Nick()
RunConsoleCommand( "adduser", plname, "moderator" )
end[/CODE]
I think it's something like that. I'm not sure what to use for plname though
so im going to try this:
[lua]function ITEM.OnEquip( ply )
local plname = ply:Nick()
RunConsoleCommand( "ulx" "adduser", plname, "Trusted" )
end[/lua]
[editline]1st December 2014[/editline]
it is not appearing, here is my code for it:
[lua]ITEM.Name = 'Trusted'
ITEM.Price = 1000000
Itme.Model = 'models/dog.mdl'
function ITEM.OnEquip( ply )
local plname = ply:Nick()
RunConsoleCommand( "ulx", "adduser", plname, "Trusted" )
end[/lua]
[QUOTE=tomis13lack2;46616079]so im going to try this:
[lua]function ITEM.OnEquip( ply )
local plname = ply:Nick()
RunConsoleCommand( "ulx" "adduser", plname, "Trusted" )
end[/lua]
[editline]1st December 2014[/editline]
it is not appearing, here is my code for it:
[lua]ITEM.Name = 'Trusted'
ITEM.Price = 1000000
Itme.Model = 'models/dog.mdl'
function ITEM.OnEquip( ply )
local plname = ply:Nick()
RunConsoleCommand( "ulx", "adduser", plname, "Trusted" )
end[/lua][/QUOTE]
[img]http://puu.sh/ddBNj/0be2cd93a8.png[/img]
should be ITEM.Model = Model('models/dog.mdl')
[QUOTE=Sm63;46617123][img]http://puu.sh/ddBNj/0be2cd93a8.png[/img]
should be ITEM.Model = Model('models/dog.mdl')[/QUOTE]
ITEM.Model = 'models/dog.mdl'
Holy shit what happened to your code?!
[lua]
ITEM.Name = 'Trusted'
ITEM.Price = 1000000
ITEM.Model = 'models/dog.mdl'
function ITEM:OnEquip( ply )
RunConsoleCommand( "ulx", "adduser", ply:Nick(), "Trusted" )
end
[/lua]
No idea why people love console commands so much when a function already exists.
ulx.adduserid(ply, ply:SteamID(), "Trusted")
or ulx.adduser(ply, ply, "Trusted")
function ulx.adduser( calling_ply, target_ply, group_name )
function ulx.adduserid( calling_ply, id, group_name )
from [url]https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/user.lua[/url]
[QUOTE=adamdburton;46619324]Holy shit what happened to your code?!
[lua]
ITEM.Name = 'Trusted'
ITEM.Price = 1000000
ITEM.Model = 'models/dog.mdl'
function ITEM:OnEquip( ply )
RunConsoleCommand( "ulx", "adduser", ply:Nick(), "Trusted" )
end
[/lua][/QUOTE]
now it appears but doesn't work
[QUOTE=Blasteh;46619362]No idea why people love console commands so much when a function already exists.
ulx.adduserid(ply, ply:SteamID(), "Trusted")
or ulx.adduser(ply, ply, "Trusted")
function ulx.adduser( calling_ply, target_ply, group_name )
function ulx.adduserid( calling_ply, id, group_name )
from [url]https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/user.lua[/url][/QUOTE]
this is giving me errors.
it wont work. Can someone help?
[editline]4th December 2014[/editline]
it is saying ITEM i undefined. it did not say that before i added ulx.adduserid( calling_ply, id, group_name )
You need to reload the map/restart the server. Pointshop does not work with autorefresh.
[QUOTE=adamdburton;46642289]You need to reload the map/restart the server. Pointshop does not work with autorefresh.[/QUOTE]
Would it ever be possible to get pointshop working with AutoRefresh? (I know you're probably long done with PS but I was just curious as making hats line up correctly is a pain when you have to reload the map for every minor adjustment)
Sorry, you need to Log In to post a reply to this thread.