SA-MP Forums Archive
THIS COMMAND - 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: THIS COMMAND (/showthread.php?tid=655970)



THIS COMMAND - Thanks - 03.07.2018

Guys!! How to fix this? When I joined a cop skin and killed who wanted level +4 or +30 It's worked only for Officers it's dose not work for FBI,SWAT,CIA,ARMY It's worked only for Police HOW TO MAKE IT WORKED FOR ALL POLICE TEAM!?

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid;
    new 
string[100 MAX_PLAYER_NAME];
    if(
gTeam[playerid] == Civilian(GetPlayerSkin(playerid) && gTeam[killerid] == PoliceTeam(GetPlayerSkin(killerid))))
        {
            if(
gTeam[killerid] == PoliceTeam(GetPlayerSkin(killerid) && GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 30))
            {
                if(
GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 3) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                if(
GetPlayerWantedLevel(playerid) == 0) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
GetPlayerName(killerid,tName,MAX_PLAYER_NAME);
                
format(stringsizeof(string), "{F3FF33}%s[%d] {ffffff}has been {00E6FD}Taken Down {ffffff}by {E6FD00}Officer %s[%d] {ffffff}Wanted: %d{ffffff}!"pNameplayeridtNamekilleridGetPlayerWantedLevel(playerid));
                
SendClientMessageToAll(yellow,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"pNameplayerid);
                
GameTextForPlayer(killeridstring70005);
                
                
BeginArrestedTime[playerid] = SetTimerEx("JailPlayer",2000,0,"i",playerid);// making 5 sec timer for jail
                
BeginArrested[playerid] = 1;
                return 
1;
            }
        }
         if(
gTeam[playerid] == Civilian(GetPlayerSkin(playerid) && gTeam[killerid] == SWAT(GetPlayerSkin(killerid))))
        {
            if(
gTeam[killerid] == SWAT(GetPlayerSkin(killerid) && GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 30))
            {
                if(
GetPlayerWantedLevel(playerid) == 0) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                if(
GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 3) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                
BeginArrested[playerid] = 1;
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
GetPlayerName(killerid,tName,MAX_PLAYER_NAME);
                
                
format(stringsizeof(string), "{F3FF33}%s[%d] {ffffff}has been {00FFFF}Taken Down {ffffff}by {00FFFF}S.W.A.T Special Forces {308AFF}%s(%d) {ffffff}which is at wanted level of {00E6FD}%d{ffffff}!"pNameplayeridtNamekilleridGetPlayerWantedLevel(playerid));
                
SendClientMessageToAll(yellow,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"pNameplayerid);
                
GameTextForPlayer(killeridstring70005);
                
                
BeginArrestedTime[playerid] = SetTimerEx("JailPlayer",2000,0,"i",playerid);// making 5 sec timer for jail
                
BeginArrested[playerid] = 1;
                return 
1;
            }
        }
        if(
gTeam[playerid] == Civilian(GetPlayerSkin(playerid) && gTeam[killerid] == Army(GetPlayerSkin(killerid))))
        {
            if(
gTeam[killerid] == Army(GetPlayerSkin(killerid) && GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 30))
            {
                if(
GetPlayerWantedLevel(playerid) == 0) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                if(
GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 3) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
GetPlayerName(killerid,tName,MAX_PLAYER_NAME);
                
format(stringsizeof(string), "{F3FF33}%s[%d] {ffffff}has been {00E6FD}Taken Down {ffffff}by {932EE7}San Andreas Army {308AFF}%s(%d){ffffff}which is at wanted level of {00E6FD}%d{ffffff}!"pNameplayeridtNamekilleridGetPlayerWantedLevel(playerid));
                
SendClientMessageToAll(yellow,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"pNameplayerid);
                
GameTextForPlayer(killeridstring70005);
                
                
BeginArrestedTime[playerid] = SetTimerEx("JailPlayer",2000,0,"i",playerid);// making 5 sec timer for jail
                
BeginArrested[playerid] = 1;
                return 
1;
            }
        }
        if(
gTeam[playerid] == Civilian(GetPlayerSkin(playerid) && gTeam[killerid] == CIA(GetPlayerSkin(killerid))))
        {
            if(
gTeam[killerid] == CIA(GetPlayerSkin(killerid) && GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 30))
            {
                if(
GetPlayerWantedLevel(playerid) == 0) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                if(
GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 3) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
GetPlayerName(killerid,tName,MAX_PLAYER_NAME);
                
format(stringsizeof(string), "{F3FF33}%s[%d] {ffffff}has been {00E6FD}Taken Down {ffffff}by {FFFFFF}Central Intelligence Agency {308AFF}%s(%d){ffffff}which is at wanted level of {00E6FD}%d{ffffff}!"pNameplayeridtNamekilleridGetPlayerWantedLevel(playerid));
                
SendClientMessageToAll(yellow,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"pNameplayerid);
                
GameTextForPlayer(killeridstring70005);
                
                
BeginArrestedTime[playerid] = SetTimerEx("JailPlayer",2000,0,"i",playerid);// making 5 sec timer for jail
                
BeginArrested[playerid] = 1;
                return 
1;
            }
        }
        if(
gTeam[playerid] == Civilian(GetPlayerSkin(playerid) && gTeam[killerid] == FBII(GetPlayerSkin(killerid))))
        {
            if(
gTeam[killerid] == FBII(GetPlayerSkin(killerid) && GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 30))
            {
                if(
GetPlayerWantedLevel(playerid) == 0) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                if(
GetPlayerWantedLevel(playerid) >= && GetPlayerWantedLevel(playerid) <= 3) return SendClientMessage(killerid, -1"{FF0000}[WARRING]: YOU CANNOT KILL PLAYERS WITHOUT NO REASON!! {ffffff}/RULES {ff0000}& {ffffff}/PC!{ff0000}!{ffffff}!");
                
SetPlayerScore(killeridGetPlayerScore(killerid)+1);
                
SetPlayerScore(playeridGetPlayerScore(playerid)-1);
                
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                
GetPlayerName(killerid,tName,MAX_PLAYER_NAME);
                
                
format(stringsizeof(string), "{F3FF33}%s[%d] {ffffff}has been {00E6FD}Taken Down {ffffff}by {308AFF}Federal Agent {308AFF}%s(%d){ffffff}which is at wanted level of {00E6FD}%d{ffffff}!"pNameplayeridtNamekilleridGetPlayerWantedLevel(playerid));
                
SendClientMessageToAll(yellow,string);
                
format(stringsizeof(string), "~b~Taken Down ~W~%s(%d)"pNameplayerid);
                
GameTextForPlayer(killeridstring70005);
                
                
BeginArrestedTime[playerid] = SetTimerEx("JailPlayer",2000,0,"i",playerid);// making 5 sec timer for jail
                
BeginArrested[playerid] = 1;
                return 
1;
            }
        }
      return 
1;




Re: THIS COMMAND - Thanks - 04.07.2018

sooooooooooooooooooooooooo


Re: THIS COMMAND - Slawi - 04.07.2018

make a debug and check