AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Some... respawn bug? (https://forums.alliedmods.net/showthread.php?t=46957)

ModoZaur 11-06-2006 03:02

Some... respawn bug?
 
Code:

//ReSpawn functions
public SpawnFunc(id)
{
 new parm[1]
 parm[0]=id
 set_task(0.5,"player_spawn",72,parm,1)
 set_task(0.7,"player_spawn",72,parm,1)
}
public player_spawn(parm[1])
{
 spawn(parm[0])
}
public RespawnDelay(id)
{
if (!FS_RoundEnds)
{
 if(FS_MaxRespawns[id]!=0)
 {
  FS_RespawnTime[id] = get_cvar_num("FS_RespawnDelay")
  RespawnLoop(id)
 }
 else
 {
  set_hudmessage(128,0,0,-1.0,0.27,0,1.0,1.5,0.0,0.0,87)
  show_hudmessage (id, "You have no respawns left")
 }
}
else
{
 set_hudmessage(128,0,0,-1.0,0.27,0,1.0,1.5,0.0,0.0,87)
 show_hudmessage (id, "Can't respawn! Round ended!")
}
}
public RespawnLoop(id)
{
if (!FS_RoundEnds)
{
 new message[128]
 format(message,127, "You will be respawned in %d seconds",FS_RespawnTime[id])
 set_hudmessage(128,0,0,-1.0,0.27,0,1.0,1.5,0.1,0.2,87)
 show_hudmessage (id, message)
 FS_RespawnTime[id]--
 if (FS_RespawnTime[id] == -1)
 {
  RespawnDelayEnd(id)
 } else
 {
  set_task(1.0,"RespawnLoop",id)
 }
}
else
{
 set_hudmessage(128,0,0,-1.0,0.27,0,1.0,1.5,0.0,0.0,87)
 show_hudmessage (id, "Respawn canceled! Round ended!")
}
}
public RespawnDelayEnd(id)
{
 new message[128]
 FS_MaxRespawns[id]--
 format(message,127, "Respawned! You have %d respawns left",FS_MaxRespawns[id])
 set_hudmessage(128,0,0,-1.0,0.27,0,1.0,1.5,0.0,0.0,87)
 show_hudmessage (id, message)
 SpawnFunc(id)
}

Here ^^^ is my respawn code for FS
RespawnDelay is called when the user die. if round is ended - respawn reseting else looping next

can you find a mistake in this.
(actually on respawn bodies is left on the ground)

ModoZaur 11-06-2006 03:08

Re: Some... respawn bug?
 
Oh i got it :) Trouble is inside the HL engine, not in the code
if respawn delay more then 3, bodies begin dropping into the floor and can not be respawned


All times are GMT -4. The time now is 07:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.