Post your scripting questions / solutions here
Moderator: Moderators
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Wed May 04, 2005 2:43 pm
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 » Wed May 04, 2005 2:51 pm
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 » Wed May 04, 2005 2:53 pm
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 » Wed May 04, 2005 2:59 pm
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.
wacko
Field Marshal
Posts: 2085 Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany
Post
by wacko » Wed May 04, 2005 3:58 pm
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 » Wed May 04, 2005 3:59 pm
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 » Wed May 04, 2005 4:01 pm
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.
agentmad007
Brigadier General
Posts: 570 Joined: Tue Feb 24, 2004 3:52 pm
Post
by agentmad007 » Wed May 04, 2005 4:15 pm
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 » Wed May 04, 2005 6:49 pm
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 » Wed May 04, 2005 6:51 pm
Can you give more details lizard plz?
Deadly and slient.