I managed to make the script working now, Tho' I now want to know if it's possible to disguise an admin? by changing the name showing and the picture and printing that your normal name disconnected and that the new name connected?. If so, how?
local CATEGORY_NAME = "ttt"
------------------------------ Spawn ------------------------------
function ulx.tspawn( calling_ply, target_plys )
local affected_plys = {}
for i=1, #target_plys do
local v = target_plys[ i ]
if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
elseif v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is already alive!", true )
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
else
v:SetTeam("Terrorists")
v:Spawn()
table.insert( affected_plys, v )
end
ulx.fancyLogAdmin( calling_ply, "#A spawned #T", affected_plys )
end
local tspawn = ulx.command( CATEGORY_NAME, "ulx tspawn", ulx.spawn, "!tspawn" )
tspawn:addParam{ type=ULib.cmds.PlayersArg }
tspawn:defaultAccess( ULib.ACCESS_ADMIN )
tspawn:help( "Spawn target(s) as terrorist." )
function ulx.traitor( Calling_ply, target_plys )
local affected_plys= {}
for i=1 #target_plys do
local v = target_plys [ i ]
if ulx.getExclusive( v, calling_ply ) then
Ulib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true
elseif not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is dead!", true)
elseif v:IsFrozen() then
Ulib.tsayError( calling_ply, v:Nick() .. " is frozen!", true)
else
v:SetRole(ROLE_TRAITOR)
sendFullStateUpdate()
end
end
end
local traitor = ulx.command( CATEGORY_NAME, "ulx traitor", ulx.traitor, "!traitor" )
traitor:addParam{ type=ULib.cmds.PlayersArg }
traitor:defautlAccess( ULib.ACCESS_ADMIN )
traitor:help( "Force target(s) to traitor" )
function ulx.detective( Calling_ply, target_plys )
local affected_plys= {}
for i=1 #target_plys do
local v = target_plys [ i ]
if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
elseif not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is dead!", true)
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true)
else
v:SetRole(ROLE_DETECTIVE)
sendFullStateUpdate()
end
end
end
local detective = ulx.command( CATEGORY_NAME, "ulx detective", ulx.detective, "!detective" )
detective:addParam{ type=Ulib.cmds.PlayersArg }
detective:defaultAccess( ULib.ACCESS_ADMIN )
detective:help( "Force target(s) to detective" )
function ulx.innocent( Calling_ply, target_plys )
local affected_plys= {}
for i=1 #target_plys do
local v = target_plys [ i ]
if ulx.getExclusive( v, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
elseif not v:Alive() then
ULib.tsayError( calling_ply, v:Nick() .. " is dead!", true )
elseif v:IsFrozen() then
ULib.tsayError( calling_ply, v:Nick() .. " is frozen!", true )
else
v:SetRole(ROLE_INNOCENT)
sendFullStateUpdate()
end
end
end
local innocent = ulx.command( CATEGORY_NAME, "ulx innocent", ulx.innocent, "!innocent" )
innocent:addParam{ type.ULib.cmds.PlayersArg }
innocent:defaultAccess( ULib.ACCESS_ADMIN )
innocent:help( "Froce target(s) to innocent" )