06.11.2011, 17:09
Anti Fake-Kill - 0.3d
pawn Код:
new
iLastDamage[MAX_PLAYERS];
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if (damagedid != INVALID_PLAYER_ID)
{
iLastDamage[damagedid] = GetTickCount();
}
}
public OnPlayerDeath(playerid, killerid, reason)
{
if (killerid != INVALID_PLAYER_ID && (iLastDamage[playerid] + 2000) < GetTickCount())
{
static
szKickMessage[128],
szPlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
format(szKickMessage, 128, "* %s has been kicked because of doing a fake kill.", szPlayerName);
SendClientMessageToAll(-1, szKickMessage);
return Kick(playerid);
}
}