SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/08/2018, 10:14 AM   #1
severance
Big Clucker
 
Join Date: Apr 2015
Posts: 126
Reputation: 8
Default how to detect deagle killer

How to detect if a player killed 5 players with deagle?
severance is offline   Reply With Quote
Old 20/08/2018, 10:21 AM   #2
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 716
Reputation: 43
Default Re: how to detect deagle killer

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;
}
KinderClans is offline   Reply With Quote
Old 20/08/2018, 10:37 AM   #3
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,243
Reputation: 525
Default Re: how to detect deagle killer

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;

Sew_Sumi is offline   Reply With Quote
Old 20/08/2018, 10:44 AM   #4
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 716
Reputation: 43
Default Re: how to detect deagle killer

Well yeah, mine it was a draft.
KinderClans is offline   Reply With Quote
Old 20/08/2018, 10:46 AM   #5
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,243
Reputation: 525
Default Re: how to detect deagle killer

Mine's the same, just knocked it out in the message window.
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deagle damage valelele Scripting Help 4 30/06/2017 04:38 PM
Help with Deagle+Moving! WertyRO Client Support 4 17/11/2011 07:01 AM
Littkw help with deagle boyan96 Scripting Help 4 01/11/2011 09:12 AM
Deagle bug ? c-middia Help Archive 11 22/10/2009 12:55 PM


All times are GMT. The time now is 03:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.