Page 1 of 1
Player waittill respawn
Posted: Wed May 04, 2005 2:43 pm
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
Posted: Wed May 04, 2005 2:51 pm
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
Posted: Wed May 04, 2005 2:53 pm
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...
Posted: Wed May 04, 2005 2:59 pm
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!
Posted: Wed May 04, 2005 3:58 pm
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?
Posted: Wed May 04, 2005 3:59 pm
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
Posted: Wed May 04, 2005 4:01 pm
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.
Posted: Wed May 04, 2005 4:02 pm
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
Posted: Wed May 04, 2005 4:15 pm
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.
Posted: Wed May 04, 2005 6:49 pm
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.
Posted: Wed May 04, 2005 6:51 pm
by agentmad007
Can you give more details lizard plz?