SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/07/2018, 11:01 PM   #1
Thanks
Huge Clucker
 
Join Date: Nov 2016
Posts: 284
Reputation: 0
Default THIS COMMAND

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 Code:
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;

Thanks is offline   Reply With Quote
Old 04/07/2018, 02:09 PM   #2
Thanks
Huge Clucker
 
Join Date: Nov 2016
Posts: 284
Reputation: 0
Default Re: THIS COMMAND

sooooooooooooooooooooooooo
Thanks is offline   Reply With Quote
Old 04/07/2018, 02:49 PM   #3
Slawi
Little Clucker
 
Join Date: Dec 2013
Posts: 47
Reputation: 1
Default Re: THIS COMMAND

make a debug and check
Slawi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with YCMD proces command and problem with "Server:Unknown command JoDe Scripting Help 1 20/04/2018 01:12 PM
[Plugin] mcmd Command Engine - Plugin based command processing Mellnik Plugin Development 108 08/05/2016 02:55 PM
i had this command in my gamemode, when i type this in game,it tells server unknow command? Chrisli520 Scripting Help 3 24/11/2013 11:02 AM
Executed ZCMD command returns SERVER: Unknown Command SexTourist Scripting Help 12 03/01/2012 04:38 PM
Slap command returns an Unknown Command when player is not connected HydraX Help Archive 16 01/08/2011 06:19 AM


All times are GMT. The time now is 09:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.