23.10.2013, 08:02
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPVarInt(playerid, "Headshotted") == 1)
{
if (gTeam[playerid] == gTeam[killerid])
{
return 0;
}
else
{
SetPVarInt(playerid, "Headshotted", 0);
GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
GameTextForPlayer(killerid, "~r~Headshott", 3000, 3);
}
}
return 1;
}
forward CheckHeadShot();
public CheckHeadShot()
{
new
index;
for(new playerid; playerid < maxPlayers; playerid++)
{
if(IsPlayerConnected(playerid))
{
index = GetPlayerAnimationIndex(playerid);
if(index == 1173 || index == 1175 || index == 1177 || index == 1178)
{
SetPVarInt(playerid, "Headshotted", 1);
SetPlayerHealth(playerid, 0);
}
}
}
return 1;
}