Raised This Month: $ Target: $400
 0% 

Some... respawn bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ModoZaur
Junior Member
Join Date: Nov 2006
Old 11-06-2006 , 03:02   Some... respawn bug?
Reply With Quote #1

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 is offline
ModoZaur
Junior Member
Join Date: Nov 2006
Old 11-06-2006 , 03:08   Re: Some... respawn bug?
Reply With Quote #2

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
ModoZaur is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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