06.03.2014, 23:12
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define col_grey 0xADADADFF
new pDied[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(GetPlayerHealth(playerid) < 10)
{
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
// Checking for their variable..
if(pDied[playerid] == 0)
{
// Spawning at ASGH in Los Santos...
pDied[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x, Float:y, Float:z;
// Resetting their position:
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z);
SetPlayerVirtualWorld(playerid, 0);
// Freezing them in death, aka not allowing them to respawn:
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 1, 1, 1);
SetPlayerVirtualWorld(playerid, 0);
// Informing them and activating timer:
SetTimerEx("DeathTimer", 99000, false, "i", playerid);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}