SA-MP Forums Archive
Help OnplayerDeath - 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 OnplayerDeath (/showthread.php?tid=546019)



Help OnplayerDeath - JawsPlus - 12.11.2014

I want to make a cops kill system.When cops kill player they will get money but every time cops kill wanted player and get -5000$ and -5 score for punishment. Ho w to fix it


PHP код:
    if(civ[killerid] == || 5)
    {
        if(
GetPlayerWantedLevel(playerid) == 0)
        {
            
SetPlayerScore(killeridGetPlayerScore(killerid)-5);
            
SendClientMessage(killeridCOLOR_LIGHTBLUE,"[POLICE]:{FFFFFF}You kill an innocent.You have -5000$ and -5 score for punishment.");
            
GivePlayerMoney(killerid, -5000);
            
SetPlayerWantedLevel(playerid,0);
            return 
1;
        }
        if(
GetPlayerWantedLevel(playerid) >= )
        {
            
SendClientMessage(killeridCOLOR_LIGHTBLUE,"[POLICE]:{FFFFFF}You kill an innocent suspects.You have -1000$ and -1 score for punishment.");
            
SetPlayerScore(killeridGetPlayerScore(killerid)-1);
            
GivePlayerMoney(killerid, -1000);
            
SetPlayerWantedLevel(playerid,0);
            return 
1;
        }
        if(
GetPlayerWantedLevel(playerid) >= )
        {
            new 
string2000[200];
            
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
            
format(string2000sizeof(string2000), "[POLICE]:{FFFFFF}%s[%d] has been taken down by Law Officer %s[%d] with %i wanted level.",GetPlayerName(playerid),playerid,GetPlayerName(killerid),killerid,GetPlayerWantedLevel(playerid));
            
SendClientMessageToAll(COLOR_BLUE,string2000);
            
GivePlayerMoney(killerid,GetPlayerWantedLevel(playerid)*100);
            
SetPlayerWantedLevel(playerid,0);
            return 
1;
        }
        if(
GetPlayerWantedLevel(playerid) >= )
        {
            new 
string2000[200];
            
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
            
format(string2000sizeof(string2000), "[POLICE]:{FFFFFF}%s[%d] has been taken down by Law Officer %s[%d] with %i wanted level.",GetPlayerName(playerid),playerid,GetPlayerName(killerid),killerid,GetPlayerWantedLevel(playerid));
            
SendClientMessageToAll(COLOR_BLUE,string2000);
            
GivePlayerMoney(killerid,GetPlayerWantedLevel(playerid)*200);
            
SetPlayerWantedLevel(playerid,0);
            return 
1;
            }
         }




Re: Help OnplayerDeath - JawsPlus - 12.11.2014

Help pls!!!


Re: Help OnplayerDeath - kloning1 - 12.11.2014

paste text under OnPlayerDeath(playerid, killerid, reason)


Re: Help OnplayerDeath - kloning1 - 12.11.2014

do you mean, if shoot criminals will get the money, if the usual shoot player will be reduced money?


Re: Help OnplayerDeath - JawsPlus - 12.11.2014

i know is like this but it always give player -5000$ and -5 score for punishment

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
 if(
civ[killerid] == || 5
    { 
        if(
GetPlayerWantedLevel(playerid) == 0
        { 
            
SetPlayerScore(killeridGetPlayerScore(killerid)-5); 
            
SendClientMessage(killeridCOLOR_LIGHTBLUE,"[POLICE]:{FFFFFF}You kill an innocent.You have -5000$ and -5 score for punishment."); 
            
GivePlayerMoney(killerid, -5000); 
            
SetPlayerWantedLevel(playerid,0); 
            return 
1
        } 
        if(
GetPlayerWantedLevel(playerid) >= 
        { 
            
SendClientMessage(killeridCOLOR_LIGHTBLUE,"[POLICE]:{FFFFFF}You kill an innocent suspects.You have -1000$ and -1 score for punishment."); 
            
SetPlayerScore(killeridGetPlayerScore(killerid)-1); 
            
GivePlayerMoney(killerid, -1000); 
            
SetPlayerWantedLevel(playerid,0); 
            return 
1
        } 
        if(
GetPlayerWantedLevel(playerid) >= 
        { 
            new 
string2000[200]; 
            
SetPlayerScore(killeridGetPlayerScore(killerid)+1); 
            
format(string2000sizeof(string2000), "[POLICE]:{FFFFFF}%s[%d] has been taken down by Law Officer %s[%d] with %i wanted level.",GetPlayerName(playerid),playerid,GetPlayerName(killerid),killerid,GetPlayerWantedLevel(playerid)); 
            
SendClientMessageToAll(COLOR_BLUE,string2000); 
            
GivePlayerMoney(killerid,GetPlayerWantedLevel(playerid)*100); 
            
SetPlayerWantedLevel(playerid,0); 
            return 
1
        } 
        if(
GetPlayerWantedLevel(playerid) >= 
        { 
            new 
string2000[200]; 
            
SetPlayerScore(killeridGetPlayerScore(killerid)+1); 
            
format(string2000sizeof(string2000), "[POLICE]:{FFFFFF}%s[%d] has been taken down by Law Officer %s[%d] with %i wanted level.",GetPlayerName(playerid),playerid,GetPlayerName(killerid),killerid,GetPlayerWantedLevel(playerid)); 
            
SendClientMessageToAll(COLOR_BLUE,string2000); 
            
GivePlayerMoney(killerid,GetPlayerWantedLevel(playerid)*200); 
            
SetPlayerWantedLevel(playerid,0); 
            return 
1
            } 
         } 




Re : Help OnplayerDeath - Dutheil - 12.11.2014

pawn Код:
if(civ[killerid] == 0 || civ[killerid] == 5)
Edit : The wanted level max is 6


Re: Help OnplayerDeath - JawsPlus - 13.11.2014

can't works