View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:53 am



Reply to topic  [ 3 posts ] 
 Function for which team I'm on. 
Author Message
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Function for which team I'm on.
self.Team is a number, normally within but not restricted to 1-4. These relate directly to the team colour.
Code:
function Update(self)
    if self.Team == 1 then
        print("Ouch! That's gotta hurt!")
    elseif self.Team == 2 then
        print("Ooh! They went there!")
    elseif self.Team == 3 then
        print("No way! That was unexpected!")
    elseif self.Team == 4 then
        print("Well, now we know how NOT to do it.")
    else
        print("Another one bites the dust!")
    end
end


Fri Feb 25, 2011 8:00 pm
Profile
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: Function for which team I'm on.
The teams are actually numbered from 0 to 3, but for readability reasons it is better to use the following constants:
Code:
Activity.TEAM_1
Activity.TEAM_2
Activity.TEAM_3
Activity.TEAM_4


Sat Feb 26, 2011 2:04 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Function for which team I'm on.
Yes it will.


Sat Feb 26, 2011 6:37 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.038s | 13 Queries | GZIP : Off ]