how to detect deagle killer
#1

How to detect if a player killed 5 players with deagle?
Reply
#2

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;
}
Reply
#3

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(-15DKmsg);
            
DKs[killerid]=0;
        }
    }
    return 
1;
}

public 
OnPlayerConnect(playerid)
{
    
DKs[playerid]=0;
    return 
1;

Reply
#4

Well yeah, mine it was a draft.
Reply
#5

Mine's the same, just knocked it out in the message window.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)