SA-MP Forums Archive
Punish COPS when kill a white\yellow player? - 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: Punish COPS when kill a white\yellow player? (/showthread.php?tid=500131)



Punish COPS when kill a white\yellow player? - UserName31 - 11.03.2014

hello i been stock on this spot of script OnPlayerDeath
i want to make when a cop kill's a white players or wanted level of 1,2 3 the cop will get punish as kick(killerid); but seems to not work here is the part of my script..

so this what i have done
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
HideDraw(playerid);
    
SendDeathMessage(killeridplayeridreason);
    
SetPlayerColor(playeridGREY);
    new 
string[256];
// thsi good t.m we will finish it and the /esc too!
    
if(gTeam[playerid] == COP)// SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+ 6);
    
{
        if(
GetPlayerWantedLevel(playerid) == 1)
        {
        
SetPlayerWantedLevel(playerid,0);
        
SendClientMessage(killeridCOLOR_YELLOW,"You Dont get wanted as  Cop xD for now No punishment!");
        return 
1;
        }
        else
          {
        
SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+ 6);
         
format(stringsizeof(string), "You Murdered %s You Now Gaint 6 more Star!"ReturnPlayerName(playerid));
         
SendClientMessage(killeridCOLOR_ERRORstring);
         }
    }
    if(
reason <= 46 && hit[playerid] != 0)
    {
        
format(stringsizeof(string), "%s (%i) killed %s (%i) for a completed hit"ReturnPlayerName(killerid), killeridReturnPlayerName(playerid), playerid);
        
SendClientMessageToAll(COLOR_MSGstring);
        
GivePlayerMoney(killeridhit[playerid]);
        
TextDrawHideForPlayer(playerid,HasHit);
        
SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+ 6);
        
GivePlayerMoney(hiter[playerid], GetPlayerMoney(hiter[playerid])-hit[playerid]);
        
hit[playerid] = 0;
    }
    else if(
hit[playerid] != 0)
    {
        
format(stringsizeof(string), "The hit on %s (%i) has been cancelled (died)"ReturnPlayerName(playerid), playerid);
        
SendClientMessageToAll(COLOR_MSGstring);
        
hit[playerid] = 0;
    }
    
IsSpawned[playerid] =0;
    if(
HaveGPS[playerid]) {
    
KillTimer(GPSTimer[playerid]);
    
HaveGPS[playerid] = false;
    
GPSTimer[playerid] = 0;
    }
    return 
true;

focus part:
PHP код:
// thsi good t.m we will finish it and the /esc too!
    
if(gTeam[playerid] == COP)// SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+ 6);
    
{
        if(
GetPlayerWantedLevel(playerid) == 1)
        {
        
SetPlayerWantedLevel(playerid,0);
        
SendClientMessage(killeridCOLOR_YELLOW,"You Dont get wanted as  Cop xD for now No punishment!");
        return 
1;
        }
        else
          {
        
SetPlayerWantedLevel(killerid,GetPlayerWantedLevel(killerid)+ 6);
         
format(stringsizeof(string), "You Murdered %s You Now Gaint 6 more Star!"ReturnPlayerName(playerid));
         
SendClientMessage(killeridCOLOR_ERRORstring);
         }
    }