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(playerid, killerid, reason)
{
    
GivePlayerMoney(playerid, -1000);
    
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
    
    
GivePlayerMoney(killerid,  1000);
    
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    return 
1;
}
// OnGameModeInit
new string[16];
for(new 
i = 1; i < MAX_VEHICLES; i++)
{
    if(
i < 10) format(string, 64, "000%d", i);
    else if(
10 <= i < 100) format(string, 64, "00%d", i);
    else if(!(
100 > i >= 1000)) format(string, 64, "0%d", i);
    else 
format(string, 64, "%d", i);
    
strcat(string, " - SDK");
    
SetVehicleNumberPlate(i, string);
}