Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 09:20:29 PM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Checking if someone is traitor?
Pages: [1]
Author Topic: Checking if someone is traitor?  (Read 5567 times)
StormX
Poster

Posts: 69


« on: May 29, 2010, 03:41:26 PM »

I've looked over TTTs code a bit, but it seems I can't find out which traitors are alive.
Tried:
GetRole() on all players: returns 1 only when traitor is dead(1=ROLE_TRAITOR), returns 0(ROLE_INNOCENT) for the ones who are alive, returns 2 for detectives who are alive(2=ROLE_DETECTIVE)

IsTraitor() on all players: returns true only when traitor is dead.

It seems I should be looking at how the information is sent?
AndyTheGeeky
Build Tester
*
Posts: 3026


Wannabe Zoidberg


« Reply #1 on: May 29, 2010, 07:41:30 PM »

Well, if you're mapping there's ttt_logic_role, and if you're (ULX, at least) admin there's a console command.  Otherwise, there's no reason the server should tell you who the living traitors are.

Signature Pending...
Ajunk
Build Tester
*
Posts: 14000


ಠ_ಠ


« Reply #2 on: May 29, 2010, 08:16:11 PM »

What exactly are you doing with this information?

You're all the most fucking heartless people
StormX
Poster

Posts: 69


« Reply #3 on: May 29, 2010, 09:20:42 PM »

What exactly are you doing with this information?


Giving all traitors a wep.
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #4 on: May 30, 2010, 12:22:29 PM »

GetRole() will return ROLE_TRAITOR on the server when called on a traitor. You seem to be checking these values on the client (which of course shouldn't know a player's true role if that client is innocent). Handing out weapons is something you will want to do on the server.

Check out player_ext_shd.lua for ply:IsActiveTraitor(), which will return true only for alive (= "active") traitors.
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Checking if someone is traitor? « 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.011 seconds with 18 queries.