Player waittill respawn

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Player waittill respawn

Post by agentmad007 »

Hello ,

I teleport the player to a jail when he die by this script :

Code: Select all

check_allies_dead:


		
		for (local.i = 1; local.i<=$player.size; local.i++) 
		{
			if ($player[local.i].dmteam == "allies") 
			{
				if (Isalive $player[local.i] == 0) 
				{

level.ald_dest++

if(level.ald_dest > 5 )
{
	level.ald_dest = 0
}

local.dest = level.ald[level.ald_dest] 

$player[local.i] tele local.dest

//level.allies_dead++

				}
			
			}

		}


		//thread winner_bomb1

end

So when he die the dead body go to the jail but when he respawn he is ingame.

I wonder how to affect the teleport only when the player respawn.

Thnaks for the help
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Oh i think $player[local.i] waittill spawn will work.Tell me if there is another way to do that , cause i am unsure if that will work.

Thanks
Deadly and slient.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Well, the player class is really not very readable. only a couple events are ever publicized by the game to the scripts. death and respawn i don't believe are sent to script...
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Damn , there is no other way to do that ?

Code: Select all

check_allies_dead:


		
		for (local.i = 1; local.i<=$player.size; local.i++) 
		{
			if ($player[local.i].dmteam == "allies") 
			{
				if (Isalive $player[local.i] == 0) 
				{


$player[local.i] waittill spawn

level.ald_dest++

if(level.ald_dest > 5 )
{
	level.ald_dest = 0
}

local.dest = level.ald[level.ald_dest] 

$player[local.i] tele local.dest

//level.allies_dead++

				}
			
			}

		}


		//thread winner_bomb1

end

None effects!
Deadly and slient.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Mmm, maybe disable all "free" spawnpoints once all players are in game and activate those in the cells then?! Problem is that u'd need to decide how many players are all :?
But there already is this Liberation mod, for example here. Isn't that what u want to do?
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Found a issue for the one intersted in.I apply the origin team again to force him spawn then i teleport his damn face to jail .

Need some improvements still , but i think there is no other ways.If someone can do that other way , i ll be glad to know .

Code: Select all

check_allies_dead:


		
		for (local.i = 1; local.i<=$player.size; local.i++) 
		{
			if ($player[local.i].dmteam == "allies") 
			{
				if (Isalive $player[local.i] == 0) 
				{



$player[local.i] join_team allies

wait 1

level.ald_dest++

if(level.ald_dest > 5 )
{
	level.ald_dest = 0
}

local.dest = level.ald[level.ald_dest] 


$player[local.i] tele local.dest


//level.allies_dead++

				}
			
			}

		}


		//thread winner_bomb1

end
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

wacko wrote:Mmm, maybe disable all "free" spawnpoints once all players are in game and activate those in the cells then?! Problem is that u'd need to decide how many players are all :?
But there already is this Liberation mod, for example here. Isn't that what u want to do?
It is mxed with objectives.So i need a custom script that fit to what i want.I ve read the bjarne script though.
Deadly and slient.
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Do you have the map file, or are you limited to pure scripting?

If you have the map file you can do it like this: http://gronnevik.se/rjukan/index.php?n= ... ionInMOHAA
Admin .MAP Forums
Image
Head above heels.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

I have the mapfile but i want to do that by script .Plus the script you pointed me out is for pure liberation gametype.However my map is mixed with objectives.There is one spawn bomb per team if one of em explode , the apprpriate team will be jailed when they die.
Deadly and slient.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Another common way is to loop a check for < 1 health. but for say 24 men on one server and 24 separate loops is a little ping-consuming.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Can you give more details lizard plz?
Deadly and slient.
Post Reply