SA-MP Forums Archive
Help with killing - 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: Help with killing (/showthread.php?tid=559504)



Help with killing - SecretBoss - 23.01.2015

I want to add a system where when a player kill another player the player who is the killer will gain some money and score how to do this any ideas?


Re: Help with killing - GGW - 23.01.2015

Yes here it is

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
    
SetPlayerScore (killeridGetPlayerScore (killerid) + 1); // change the number (1 ) to any score you want
    
SendClientMessage(killerid,COLOR_LIGHTBLUE,"You Got 5$ and 1 Score For This Kill ");
    
Player[killerid][pKills]++;
    
GivePlayerMoneyExkillerid,5);// change the number ( 5 ) to any money amount you want
    
}
    return 
1;
   }