Help OnplayerDeath
#1

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;
            }
         }

Reply
#2

Help pls!!!
Reply
#3

paste text under OnPlayerDeath(playerid, killerid, reason)
Reply
#4

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

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
            } 
         } 

Reply
#6

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

can't works
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)