Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 09:31:08 AM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

  Show Posts
Pages: [1]
1  Other / Trouble in Terrorist Town / Re: TTT Admin Commands For ULX (Download) on: August 30, 2010, 08:51:00 PM
@Mr. Gash:

It should work, that's how I tested it first. I added the other functions only later on.
TTT v12.

I downloaded ULX from their site a couple of days ago.
2  Other / Trouble in Terrorist Town / TTT Admin Commands For ULX (Download) on: August 30, 2010, 11:31:22 AM
I coded 4 new buttons for the ULX admin addon.


    [li]Respawn - Respawns a player. Can be very helpful in RDM cases.[/li]
    [li]Traitor - Turns a player into a traitor.[/li]
    [li]Detective - Turns a player into a detective.[/li]
    [li]Innocent - Turns a player into an innocent.[/li]




Download:
http://hotfile.com/dl/65736743/cfcf4e8/ttt.lua.html

Put the file in:
/garrysmod/addons/ulx/lua/ulx/modules/ttt.lua

The code in case the file host deletes the file sometime (ttt.lua):
--[[
Title: TTT

Some TTT related functions (respawn,traitor,detective,innocent)

Made by Oren Yomtov (thenameisoren at gmail)
]]
ulx.setCategory( "TTT" )

function ulx.cc_respawn( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A respawned #T" )
v:SpawnForRound(true)
end
end
ulx.concommand( "respawn", ulx.cc_respawn, "<user(s)> - Respawns target(s).", ULib.ACCESS_ADMIN, "!respawn", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Respawn", "ulx respawn" )

function ulx.cc_traitor( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A turned #T into a traitor" )
v:SetRole(ROLE_TRAITOR)
SendFullStateUpdate()
end
end
ulx.concommand( "traitor", ulx.cc_traitor, "<user(s)> - Turns target(s) into traitors.", ULib.ACCESS_ADMIN, "!traitor", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Traitor", "ulx traitor" )

function ulx.cc_detective( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A turned #T into a detective" )
v:SetRole(ROLE_DETECTIVE)
SendFullStateUpdate()
end
end
ulx.concommand( "detective", ulx.cc_detective, "<user(s)> - Turns target(s) into detectives.", ULib.ACCESS_ADMIN, "!detective", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Detective", "ulx detective" )

function ulx.cc_innocent( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A turned #T into an innocent" )
v:SetRole(ROLE_INNOCENT)
SendFullStateUpdate()
end
end
ulx.concommand( "innocent", ulx.cc_innocent, "<user(s)> - Turns target(s) into innocents.", ULib.ACCESS_ADMIN, "!innocent", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "Innocent", "ulx innocent" )
Pages: [1]


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.009 seconds with 19 queries.