ULX

Author Topic: Can't get my custom command to work  (Read 1810 times)

0 Members and 4 Guests are viewing this topic.

Offline JeromyHan

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Can't get my custom command to work
« on: January 11, 2016, 07:14:47 PM »
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: [Select]
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" )

Thanks for the help

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Can't get my custom command to work
« Reply #1 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"
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JeromyHan

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Can't get my custom command to work
« Reply #2 on: January 11, 2016, 07:32:52 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"

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

Offline JeromyHan

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Can't get my custom command to work
« Reply #3 on: January 11, 2016, 07:36:12 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

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!