General > Developers Corner
Can't get my custom command to work
(1/1)
JeromyHan:
Hello I'm making a demote command so admins can demote player from their job. The console command for it is "rp_citizen playername"
This is the code I made:
--- Code: ---function ulx.demote( calling_ply, terget_ply )
game.ConsoleCommand( "rp_citizen ", target_ply)
ulx.fancyLogAdmin( calling_ply, true, "#A Demoted #T", target_ply )
end
local demote = ulx.command( "Custom", "ulx demote", ulx.demote, "!demote", true )
demote:addParam{ type=ULib.cmds.PlayersArg }
demote:defaultAccess( ULib.ACCESS_ADMIN )
demote:help( "Demotes the target from his job" )
--- End code ---
Thanks for the help
JamminR:
http://forums.ulyssesmod.net/index.php/topic,8718.0.html
Though more than welcome to create your own, I always recommend learning from what's already been done.
Found that searching from our front page for "rp_citizen"
JeromyHan:
--- Quote from: JamminR on January 11, 2016, 07:24:51 PM ---http://forums.ulyssesmod.net/index.php/topic,8718.0.html
Though more than welcome to create your own, I always recommend learning from what's already been done.
Found that searching from our front page for "rp_citizen"
--- End quote ---
I have tried this on the server but the command does not work. It says that it demoted me but didn't actualy demote me
JeromyHan:
--- Quote from: JeromyHan on January 11, 2016, 07:32:52 PM ---I have tried this on the server but the command does not work. It says that it demoted me but didn't actualy demote me
--- End quote ---
I'm so stupid I did not see there was a fix for it just copied the code. Thank you very much for your help!
Navigation
[0] Message Index
Go to full version