28.12.2014, 21:55
Ok, I got your problem. You are using the wrong callback, you should use the "OnPlayerSpawn" instead.
Try this:
Try this:
pawn Код:
//On top:
new bool:pDead[MAX_PLAYERS] = false;
// Callbacks:
public OnPlayerDeath(playerid, killerid, reason)
{
// Your code
pDead[playerid] = true;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(pDead[playerid] == true)
{
SetPlayerInterior(playerid, 2);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 2563.9680, -1821.03295, 1223.7919);
TogglePlayerControllable(playerid, 0);
SetTimerEx("UnfreezePlayer", 10000, false, "i", playerid);
return 1;
}
// Put this code in the BEGINNING of the callback.
}
forward UnfreezePlayer(playerid);
public UnfreezePlayer(playerid)
{
TogglePlayerControllable(playerid, 1);
pDead[playerid] = false;
SpawnPlayer(playerid);
SendClientMessage(playerid, -1, "You are free!");
return 1;
}