how to detect deagle killer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to detect deagle killer (
/showthread.php?tid=658001)
how to detect deagle killer -
severance - 20.08.2018
How to detect if a player killed 5 players with deagle?
Re: how to detect deagle killer -
KinderClans - 20.08.2018
pawn Code:
new PlayersKilled[MAX_PLAYERS];
OnPlayerDeath:
pawn Code:
new weaponid = GetPlayerWeapon(killerid);
if (weaponid == 24) PlayersKilled[killerid] ++;
CheckDeagleKills(killerid);
pawn Code:
stock CheckDeagleKills(playerid)
{
if (PlayersKilled[playerid] == 5) SendClientMessage(playerid, -1, "* Killed 5 players with deagle.");
return 1;
}
Re: how to detect deagle killer -
Sew_Sumi - 20.08.2018
That's bad..... Like, bad....
PHP Code:
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;
}
Re: how to detect deagle killer -
KinderClans - 20.08.2018
Well yeah, mine it was a draft.
Re: how to detect deagle killer -
Sew_Sumi - 20.08.2018
Mine's the same, just knocked it out in the message window.