Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 01:43:47 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT Admin Commands For ULX (Download)
Pages: 1 [2]
Author Topic: TTT Admin Commands For ULX (Download)  (Read 11977 times)
Meta-Stick
Poster

Posts: 481


it contains, a daisy box


« Reply #20 on: September 01, 2010, 11:39:40 AM »

In what situation are any of these commands usable? Tell me. THERE ARE NONE, besides testing. If a traitor gets RDM'd he gets ID'd and everyone knows he's a traitor. If an innocent gets RDM'd, and ID'd everyone knows he is innocent.

So when they get revived, it narrows it down to who the traitors are when you revive the innocents,. Also makes the traitors targets because you know who they are if you revive them.


I don't even have to explain why the other two are bad.

Just grab some bottles and stick them in girls...
phoenixf129
Poster

Posts: 476


I Rise from the Ashes.


« Reply #21 on: September 01, 2010, 12:02:38 PM »

The respawn doesn't work anyway, it just says player name respawned, but they're not :)

Well that's what happened before.

Software Upgrade Paradox - If you improve a piece of software enough times, you eventually ruin it.
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #22 on: September 03, 2010, 07:42:30 AM »

I have a functioning respawn script, however on my server its used either for testing or if somone died due to testing or some other random glitch event such as dying just as the round starts.

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Mr. Gash
Poster

Posts: 382


www.nonerdsjustgeeks.com


« Reply #23 on: September 03, 2010, 08:49:01 PM »

Mind sharing the script? ;]
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #24 on: September 04, 2010, 06:50:29 AM »

this goes directly into the shared.lua file. Please note it respawns you as innocent.


function FindPlayer(target)
local players = player.GetAll()
target = target:lower()
for _, player in ipairs( players ) do
if target == player:Nick():lower() then
return player
end
end
local plyMatch
for _, player in ipairs( players ) do
if player:Nick():lower():find( target, 1, true ) then
if plyMatch then
return nil
end
plyMatch = player
return plyMatch
end
end

if not plyMatch then
return nil
end
end


ChatCommands = {}

function AddChatCommand(cmd, callback)
for k,v in pairs(ChatCommands) do
if cmd == v.cmd then return end
end
table.insert(ChatCommands, {cmd = cmd, callback = callback})
end

function ChatCommandSay(ply, text)
for k, v in pairs(ChatCommands) do
if string.lower(v.cmd) == string.Explode(" ", string.lower(text))[1] then
return v.callback(ply, "" .. string.sub(text, string.len(v.cmd) + 2, string.len(text)))
end
end
end
hook.Add("PlayerSay", "ChatCommandSay", ChatCommandSay)

local function SendPlayerRoles()
  for k, v in pairs(player.GetAll()) do
      umsg.Start("ttt_role", v)
      umsg.Char(v:GetRole())
      umsg.End()     
  end
end

local function SendRoleListMessage(role, role_ids, ply_or_rf)
  umsg.Start("role_list", ply_or_rf)
  -- send what kind of list this is
  umsg.Char(role)

  -- list contents
  local num_ids = #role_ids
  umsg.Char(num_ids)
  for i=1, num_ids do
      umsg.Short(role_ids[i])
  end
  umsg.End()
end

local function SendRoleList(role, ply_or_rf, pred)
  local role_ids = {}
  for k, v in pairs(player.GetAll()) do
      if v:IsRole(role) then
        if not pred or (pred and pred(v)) then
            table.insert(role_ids, v:EntIndex())
        end
      end
  end

  SendRoleListMessage(role, role_ids, ply_or_rf)
end

function SendInnocentList(ply_or_rf)
  -- Send innocent and detectives a list of actual innocents + traitors, while
  -- sending traitors only a list of actual innocents.
  local inno_ids = {}
  local traitor_ids = {}
  for k, v in pairs(player.GetAll()) do
      if v:IsRole(ROLE_INNOCENT) then
        table.insert(inno_ids, v:EntIndex())
      elseif v:IsRole(ROLE_TRAITOR) then
        table.insert(traitor_ids, v:EntIndex())
      end
  end

  -- traitors get actual innocent, so they do not reset their traitor mates to
  -- innocence
  SendRoleListMessage(ROLE_INNOCENT, inno_ids, GetTraitorFilter())

  -- detectives and innocents get an expanded version of the truth so that they
  -- reset everyone who is not detective
  table.Add(inno_ids, traitor_ids)
  table.Shuffle(inno_ids)
  SendRoleListMessage(ROLE_INNOCENT, inno_ids, GetInnocentFilter())
end

function SendRespawnToAll()
SendPlayerRoles()
SendInnocentList()
end

function RespPlay(ply, args)
if args != nil then
playerz = FindPlayer(args)
end
if playerz == nil then
    ply:PrintMessage(HUD_PRINTTALK, "User Not Found")
else
if not ValidEntity(ply) or ply:IsSuperAdmin() or ply:IsAdmin() then
      playerz:SetRole(ROLE_INNOCENT)
      playerz:UnSpectate()
      playerz:SetTeam(TEAM_TERROR)

      playerz:StripAll()

      playerz:Spawn()
  ply:PrintMessage(HUD_PRINTTALK, "You Have Respawned A User.")
      playerz:PrintMessage(HUD_PRINTTALK, "You have been respawned.")

      SendRespawnToAll() 
  else
  ply:PrintMessage(HUD_PRINTTALK, "Failed To Resapwn Player. Check That You Are Admin.")

end
end
end
AddChatCommand("!respawn", RespPlay)


Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Chrik
Poster

Posts: 36

Owner Of SLAGaming.net Community


« Reply #25 on: September 10, 2010, 09:07:52 AM »

The setrole function wont work correctly as the client runs the function at start of round. (So it shows him that he is traitor).

TTT #1: 109.70.148.68:27015
TTT #2: 109.70.148.68:27018

TTT servers with a Hats/Models Shop, achievements, highscores and more!
Manmax75
Poster

Posts: 254


Programming Guy


« Reply #26 on: September 11, 2010, 03:44:09 AM »

It does work correctly and has been ever since I made it... :|

Ride Forward and Thrust Your Pelvis In The Dark Void. The One Induced By Pleasure Yet Cast By The Bigger Picture.
Pages: 1 [2]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: TTT Admin Commands For ULX (Download) « previous next »
Jump to:  


Login with username, password and session length

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