Ulysses

General => Developers Corner => Topic started by: Dylan Baldwin on June 29, 2015, 03:54:40 PM

Title: Help!
Post by: Dylan Baldwin 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" )
Title: Re: Help!
Post by: Zmaster 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() )
Title: Re: Help!
Post by: Dylan Baldwin on June 29, 2015, 05:13:42 PM
Thank you so much !