local CATEGORY_NAME = "TTT"
function ulx.cc_respawn( ply, targs )
for _, v in ipairs( targs ) do
v:SpawnForRound(true)
end
ulx.fancyLogAdmin( ply, true, "#A respawned #T", targs )
end
local respawn = ulx.command( CATEGORY_NAME, "ulx respawn", ulx.cc_respawn, "!respawn", true )
respawn:addParam{ type=ULib.cmds.PlayersArg, hint="<user(s)>" }
respawn:defaultAccess( ULib.ACCESS_SUPERADMIN )
respawn:help( "Respawn a player." )
function ulx.cc_traitor( ply, targs )
for _, v in ipairs( targs ) do
v:SetRole(ROLE_TRAITOR)
end
SendFullStateUpdate()
ulx.fancyLogAdmin( ply, true, "#A turned #T into a traitor", targs )
end
local traitor = ulx.command( CATEGORY_NAME, "ulx traitor", ulx.cc_traitor, "!traitor", true )
traitor:addParam{type=ULib.cmds.PlayersArg, hint = "<user(s)>"}
traitor:defaultAccess( ULib.ACCESS_SUPERADMIN )
traitor:help( "Turns target(s) into a traitor." )
function ulx.cc_detective( ply, targs )
for _, v in ipairs( targs ) do
v:SetRole(ROLE_DETECTIVE)
end
SendFullStateUpdate()
ulx.fancyLogAdmin( ply, true, "#A turned #T into a detective", targs )
end
local detective = ulx.command( CATEGORY_NAME, "ulx detective", ulx.cc_detective, "!detective", true )
detective:addParam{type=ULib.cmds.PlayersArg, hint = "<user(s)>"}
detective:defaultAccess( ULib.ACCESS_SUPERADMIN )
detective:help( "Turns target(s) into a detective." )
function ulx.cc_innocent( ply, targs )
for _, v in ipairs( targs ) do
v:SetRole(ROLE_INNOCENT)
end
SendFullStateUpdate()
ulx.fancyLogAdmin( ply, true, "#A turned #T into a innocent", targs )
end
local innocent = ulx.command( CATEGORY_NAME, "ulx innocent", ulx.cc_innocent, "!innocent", true )
innocent:addParam{type=ULib.cmds.PlayersArg, hint = "<user(s)>"}
innocent:defaultAccess( ULib.ACCESS_SUPERADMIN )
innocent:help( "Turns target(s) into an innocent." )
Here you go! There is one bug with the score at the end showing you as an innocent still. I couldn't find a way around this. Nor could the creator seeing as his built in command is the same way.
$5 is fine @ -snip- via PayPal
Shouldn't have taken me as long as it did, but I was trying to find a way around that one bug.
EDIT: Create a Lua file in your addons/ulx/lua/ulx/modules/sh/ folder and paste it in that file. You can name it what ever you'd like.