20.08.2018, 10:14
How to detect if a player killed 5 players with deagle?
new PlayersKilled[MAX_PLAYERS];
new weaponid = GetPlayerWeapon(killerid);
if (weaponid == 24) PlayersKilled[killerid] ++;
CheckDeagleKills(killerid);
stock CheckDeagleKills(playerid)
{
if (PlayersKilled[playerid] == 5) SendClientMessage(playerid, -1, "* Killed 5 players with deagle.");
return 1;
}
new DKs[MAX_PLAYERS];
public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid!=INVALID_PLAYER_ID&&reason==24)
{
DKs[killerid]++;
if(DKs[killerid]>=5)
{
new 5DKmsg[80]
format(5DKmsg,sizeof(5DKmsg), "*** %s has got 5 Desert Eagle Kills ***", GetPlayerName(killerid));
SendMessageToAll(-1, 5DKmsg);
DKs[killerid]=0;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
DKs[playerid]=0;
return 1;
}