obj problem when changing team

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

obj problem when changing team

Post by fuhrer »

whats the script command for checking whether someone changes team, i have an obj wher eu gotta take some docs somewhere but if u change team u keep a hold of em, i want the docs to drop in the place u was when u changed team. if that can be done.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes it can be done, but it's little bit of work (not too much, though). For instance say you have a thread that starts when a player picks up the docs, and the player is 'local.player', then you could do s/th like this:

Code: Select all

local.startteam = local.player.dmteam
while(local.player != NIL && isAlive local.player && local.player.dmteam == local.startteam)
  waitframe

// player has changed team or died or disconnected
// add some code to drop the docs here
The local.player != NIL bit is to check whether the player hasn't left the battle (disconnected from server).
Image
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

cheers jv thats perfect
Post Reply