• Help with RunConsoleCommand
    4 replies, posted
Hi, I try to add a player to a specific group when net message arrives to server : [CODE]net.Receive('addulxgroup' , function ( len , ply ) local ulxgroup = net.ReadString() timer.Simple(3 ,function() RunConsoleCommand("ulx adduser", ply:GetName() ,ulxgroup ) end) end)[/CODE] But this gives this error : [CODE] The first parameter of this function should contain only the command, the second parameter should contain arguments.[/CODE] Could anyone tell me what is wrong on the code? :S
RunConsoleCommand doesn't like spaces. You should do RunConsoleCommand("ulx", "adduser", other, stuff)
Thank you! It works fine now :)
[QUOTE=FVJohnny;49521164]Hi, I try to add a player to a specific group when net message arrives to server : [CODE]net.Receive('addulxgroup' , function ( len , ply ) local ulxgroup = net.ReadString() timer.Simple(3 ,function() RunConsoleCommand("ulx adduser", ply:GetName() ,ulxgroup ) end) end)[/CODE] But this gives this error : [CODE] The first parameter of this function should contain only the command, the second parameter should contain arguments.[/CODE] Could anyone tell me what is wrong on the code? :S[/QUOTE] Jesus fuck don't tell me you're using that in a production server. Here's why: 1. Force sv_allowcslua to 1 2. [lua] net.Start( "addulxgroup" ) net.WriteString( "owner" ) net.SendToServer() [/lua] 3. Player now owns your server (at least on ulx)
As guy above said, its extremely unsafe. Make some checks so people don't abuse it :p
Sorry, you need to Log In to post a reply to this thread.