ItsMods
[Request] When connected - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Request] When connected (/Thread-Request-When-connected.html)



When connected - isokasi - 02-01-2011

Does any1 happen to know the code for when you join the game, it will automatically spawn every player on one team. I know its something like:
Code:
Joined_Team() { if(joined.team) == ["axis"] self maps\mp\gametypes\_teams::changeTeam("allies"); }



RE: When connected - 4FunPlayin - 02-01-2011

Code:
if(self.pers["team"] == "axis") self [[level.allies]]();



RE: When connected - isokasi - 02-01-2011

didnt work but i got this to work instead
Code:
Joined_team() { if(self.team == "axis") self maps\mp\gametypes\_teams::changeTeam("allies"); }
EDIT: ugh, my controls freeze when spawning, so this doesnt seem to work either
EDIT2: nvm i moved Joined_team() from onPlayerSpawned() to onJoinedTeam() and it works now

EDIT3: ok, now i want to make so when you die you will switch teams.. i have this code and it works but the other code is switching me back so how do i make it skip the code?
Code:
When_Died() { self waittill("death"); self maps\mp\gametypes\_teams::changeTeam("axis"); }



RE: When connected - alistair3149 - 02-01-2011

(02-01-2011, 16:44)isokasi Wrote: didnt work but i got this to work instead
Code:
Joined_team() { if(self.team == "axis") self maps\mp\gametypes\_teams::changeTeam("allies"); }
EDIT: ugh, my controls freeze when spawning, so this doesnt seem to work either
EDIT2: nvm i moved Joined_team() from onPlayerSpawned() to onJoinedTeam() and it works now

EDIT3: ok, now i want to make so when you die you will switch teams.. i have this code and it works but the other code is switching me back so how do i make it skip the code?
Code:
When_Died() { self waittill("death"); self maps\mp\gametypes\_teams::changeTeam("axis"); }
It seems that u put Joined_team() in the wrong place



RE: When connected - 4FunPlayin - 02-01-2011

Everyone just ignore my comments do they?

Code:
When_Died() { self waittill("death"); self [[level.axis]](); }



RE: When connected - No One - 02-01-2011

if the thread where u want them to join the teams u need to end it on something.
On a timer or something
Code:
self notify("When_Died"); self endon("When_Died");
but u should ask 4funplayin since he got it to work