ULX

Author Topic: Help!  (Read 1810 times)

0 Members and 1 Guest are viewing this topic.

Offline Dylan Baldwin

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Help!
« on: June 29, 2015, 03:54:40 PM »
Hello! I need help making a custom command for my DarpRP server.

I can't get the Console command to run it says invaild args, the command is ment to be rp_citizen {name}. But inserting target_ply doesnt work ? D:


Code: [Select]
local CATERGORY_NAME = "DarkRP Commands"

function ulx.forcedemote( calling_ply, target_ply )

if target_ply:Alive() then
RunConsoleCommand("rp_citizen", target_ply )
target_ply:ChatPrint("You have been demoted by "..calling_ply:Nick().."!")
ulx.fancyLogAdmin( calling_ply, true, "#A demoted #T", target_ply )
end

end

local forcedemote = ulx.command( CATERGORY_NAME, "ulx forcedemote", ulx.forcedemote, "!fdemote", true )

forcedemote:addParam{ type=ULib.cmds.PlayerArg }
forcedemote:defaultAccess( ULib.ACCESS_ADMIN )
forcedemote:help( "Force Demoted A Player" )

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Help!
« Reply #1 on: June 29, 2015, 04:10:21 PM »
target_ply is an entity, not a name
Your RunConsoleCommand should look like this:
RunConsoleCommand("rp_citizen", target_ply:Nick() )

Offline Dylan Baldwin

  • Newbie
  • *
  • Posts: 5
  • Karma: 1
Re: Help!
« Reply #2 on: June 29, 2015, 05:13:42 PM »
Thank you so much !