public OnPlayerDeath(playerid, killerid, reason)
{
new kName[128];
new pID;
new string[500+MAX_PLAYER_NAME];
Dead[playerid] = 1;
// SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
// KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
{
new WeapName[32], Name[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME];
GetWeaponName(reason, WeapName, sizeof(WeapName));
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
GetPlayerName(killerid, KillerName, MAX_PLAYER_NAME);
format(string, sizeof(string),"%s (%d) Died. Killed By: %s (%d) - %s. ", Name, playerid, KillerName, killerid, WeapName);
SendClientMessageToAll(COLOR_DARKRED, string);
}
else
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
format(string, sizeof(string),"%s (%d) Died.", Name, playerid);
SendClientMessageToAll(COLOR_DARKRED, string);
}
if(InDMS[playerid] == 1)
{
new Random = random(sizeof(RandomDMSpawns));
SetPlayerPos(playerid, RandomDMSpawns[Random][0], RandomDMSpawns[Random][1], RandomDMSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomDMSpawns[Random][3]);
SetTimer("DMSTimer", 3000, false);
}
else SendDeathMessage(killerid, playerid, reason);
new bool:IsKilledByAdmin[MAX_PLAYERS]=false;//on top
IsKilledByAdmin[targetid]=true;//this in admin kill command targetid=the player killed
if(IsKilledByAdmin[playerid]==true)return IsKilledByAdmin[playerid]=false;//this OnPlayerDeath on top of all things
if(IsPlayerAdmin(killerid))
{
// killer was an admin
}
else
{
// killer was not an admin
}
if(pLevel[killerid] > 0)
{
// killer's level is more than 0, which is admin level 1 or higher.
}
else
{
// kiler's level 0 or not admin
}
if(killerid != INVALID_PLAYER_ID)
{
// code here
Duty[playerid] = 1;
SetPVarInt(playerid, "Amode", 1);
Dont really understand, my admin is this
pawn Код:
|
if(Duty[killerid] == 1 || GetPVarInt(killerid, "Amode") == 1)
{
// killed by on duty admin
}
else
{
// not killed by on duty admin
}