SA-MP Forums Archive
Help with OnPlayerDeath and more - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with OnPlayerDeath and more (/showthread.php?tid=271493)



Help with OnPlayerDeath and more - Azzeto - 24.07.2011

How do I make it so when a player dies he will lose $1000 and 1 score but when he kills some one he will gain 1000$ and 1 score

EDIT--And how do I make custom Plates, So for example it would say SDK for every vehicle plate?


Re: Help with OnPlayerDeath and more - MoroDan - 24.07.2011

PHP код:
// OnPlayerDeath
public OnPlayerDeath(playeridkilleridreason)
{
    
GivePlayerMoney(playerid, -1000);
    
SetPlayerScore(playeridGetPlayerScore(playerid) - 1);
    
    
GivePlayerMoney(killerid,  1000);
    
SetPlayerScore(killeridGetPlayerScore(killerid) + 1);
    return 
1;
}
// OnGameModeInit
new string[16];
for(new 
1MAX_VEHICLESi++)
{
    if(
10format(string64"000%d"i);
    else if(
10 <= 100format(string64"00%d"i);
    else if(!(
100 >= 1000)) format(string64"0%d"i);
    else 
format(string64"%d"i);
    
strcat(string" - SDK");
    
SetVehicleNumberPlate(istring);