29.12.2010, 03:45
hi,
after a players death i want that the victim is able to watch (spectate) his killer for a few secs before respawning.
Thats not that hard, ive got the needed timers and functions but the spectating is working for me only!
Only my victim can specate (watch) me after ive killed him.
The other players have the pleasure to watch an area part of los santos.
Wheres the error?
regards...
after a players death i want that the victim is able to watch (spectate) his killer for a few secs before respawning.
Thats not that hard, ive got the needed timers and functions but the spectating is working for me only!
Only my victim can specate (watch) me after ive killed him.
The other players have the pleasure to watch an area part of los santos.
Wheres the error?
pawn Код:
forward Spectateafterdeathend(playerid);
forward Spectatelagtimer(playerid,killerid);
public Spectateafterdeathend(playerid)
{
TogglePlayerSpectating(playerid,0);
KillTimer(CRESDisable);
countdownrespawn = 6;
TextDrawHideForPlayer(playerid,MiniCountdownrespawn);//this is the texdraw countdown, showing the killed player how long he has to wait for the spawn
return 1;
}
public counterrespawning(playerid,killerid)
{
if(countdownrespawn > 0)
{
CRESDisable = SetTimer("counterrespawning",990,false);
new textformat[85];
format(textformat,sizeof textformat,"~r~%d",countdownrespawn);
TextDrawSetString(MiniCountdownrespawn,textformat);
TextDrawShowForPlayer(playerid,MiniCountdownrespawn);
countdownrespawn --;
}
return 1;
}
public Spectatelagtimer(playerid,killerid)
{
TogglePlayerSpectating(playerid,1);
PlayerSpectatePlayer(playerid,killerid,SPECTATE_MODE_NORMAL);
SetTimerEx("Spectateafterdeathend", 6000,0,"i",playerid);//the textdrawcountdown counts from 6 down to 0
counterrespawning(playerid,killerid);
return 1;
}
//OnPlayerDeath
SetTimerEx("Spectatelagtimer",3300,0,"i",playerid); //it takes 3,3 secs after death to enter the spectating mode
regards...