SA-MP Forums Archive
little question of on player death - 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: little question of on player death (/showthread.php?tid=546116)



little question of on player death - JawsPlus - 13.11.2014

What's wrong with this when in game i kill a player with 6 wanted level , but i still -5000$ and -5 score
What's wrong can anybody help

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
     if(
civ[killerid] == || 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);
            
SendDeathMessage(killerid,playerid,reason);
            
GivePlayerMoney(playerid,-1000);
          }
        else 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);
            
SendDeathMessage(killerid,playerid,reason);
            
GivePlayerMoney(playerid,-1000);
        }
        else if(
GetPlayerWantedLevel(playerid) >= )
        {
            new 
string2000[200];
            
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);
            
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
            
GivePlayerMoney(killerid,GetPlayerWantedLevel(playerid)*100);
            
SendDeathMessage(killerid,playerid,reason);
            
GivePlayerMoney(playerid,-1000);
        }
           else if(
GetPlayerWantedLevel(playerid) >= 12)
        {
        new 
string2000[200];
        
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);
        
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
        
GivePlayerMoney(killerid,GetPlayerWantedLevel(playerid)*200);
        
SendDeathMessage(killerid,playerid,reason);
        
GivePlayerMoney(playerid,-1000);
         }
        return 
1;
    }
    else if(
civ[killerid] == TEAM_Civ || TEAM_FireMan)
    {
        
SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
        
SetPlayerWantedLevel(killeridGetPlayerWantedLevel(killerid) +12);
        
SendDeathMessage(killerid,playerid,reason);
        
GivePlayerMoney(playerid,-1000);
    }
    return 
1;