SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 10/09/2019, 08:51 PM   #1
RedRex
Huge Clucker
 
RedRex's Avatar
 
Join Date: Jan 2016
Location: Portugal <3
Posts: 496
Reputation: 29
Exclamation Not working... no errors / warrings..

What's wrong with this? I haven't got any bugs / warrings... But When I pressing MMB To arrest someone it's not working..They giving me 0 message & the command not working actuclly... why?

PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],string[128], rangepass 0;
    new 
Float:XFloat:YFloat:Z;
    if ((
newkeys KEY_LOOK_BEHIND) && !(oldkeys KEY_LOOK_BEHIND))
    {
        if(!
PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
        {
            foreach(new 
targetid:Player)
            {
                    
GetPlayerPos(targetidXYZ);
                    if(
GetPlayerInterior(playerid) > 0) return SendClientMessage(playeridred"{FF0000}Error: You can't arrest players inside an interior.");
                    if(
GetPVarInt(playerid,"ArTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"{FF0000}Error: Please wait 5 seconds before arresting a suspect again.");
                    if(
PlayerInfo[targetid][pJailed] == 1) return SendClientMessage(playeridred"{FF0000}Error: This player is already in jail, you can't arrest them.");
                    if(
IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,red,"{FF0000}Error: You can't arrest players if they're in a vehicle.");
                    if(
GetPlayerWantedLevel(targetid) <= 3) return SendClientMessage(playeridred"{FF0000}Error: You can't arrest players with a wanted level lower than 4. Use /tk to issue a ticket, or press 2.");
                    if(
GetPlayerWantedLevel(targetid) == 0) return SendClientMessage(playeridred"{FF0000}Error: This player is not wanted, you can't arrest them");
                    if(
playerid == targetid) return SendClientMessage(playerid,red"{ff0000}Error: {ffffff}You can't arrest yourself.");
                    if(
PlayerHasTakenDamage[playerid] == targetid) return SendClientMessage(playeridRED"[WARRING]: YOU CANNOT ARREST THIS PLAYER BECAUSE HE SHOOTED YOU...");
                    if (!
IsPlayerInRangeOfPoint(playerid5.0XYZ)) return SendClientMessage(playerid, -1"Error: Nobody close enough to arrest.");
                    
GetPlayerName(playeridpNamesizeof(pName));
                    
GetPlayerName(targetidtNamesizeof(tName));
                    if(
IsPlayerConnected(targetid))
                    {
                        if(
SWAT(GetPlayerSkin(playerid)))
                        {
                            if(
GetPlayerWantedLevel(targetid) >= 4)
                            {
                                    
rangepass++;
                                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                                    
TryingArrested[playerid] = 1;
                                    
ArrestingPlayer[targetid] = playerid;
                                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}S.W.A.T AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                                    
format(stringsizeof(string), "~W~AN ~B~S.W.A.T AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                                    
GameTextForPlayer(targetidstring40005);
                                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] S.W.A.T AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                                    
SendClientMessage(playeridredstring);
                                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                                    return 
1;
                                }
                            }
                            if(
Army(GetPlayerSkin(playerid)))
                            {
                                if(
GetPlayerWantedLevel(targetid) >= 4)
                                {
                                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                                    
TryingArrested[playerid] = 1;
                                    
ArrestingPlayer[targetid] = playerid;
                                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}A.R.M.Y AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                                    
format(stringsizeof(string), "~W~AN ~P~ARMY AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                                    
GameTextForPlayer(targetidstring40005);
                                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] A.R.M.Y AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                                    
SendClientMessage(playeridredstring);
                                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                                    return 
1;
                                }
                             }
                            if(
FBII(GetPlayerSkin(playerid)))
                            {
                                if(
GetPlayerWantedLevel(targetid) >= 4)
                                {
                                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                                    
TryingArrested[playerid] = 1;
                                    
ArrestingPlayer[targetid] = playerid;
                                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}F.B.I AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                                    
format(stringsizeof(string), "~W~AN ~B~F.B.I AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                                    
GameTextForPlayer(targetidstring40005);
                                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] F.B.I AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                                    
SendClientMessage(playeridredstring);
                                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                                    return 
1;
                                }
                            }
                            if(
CIA(GetPlayerSkin(playerid)))
                            {
                                if(
GetPlayerWantedLevel(targetid) >= 4)
                                {
                                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                                    
TryingArrested[playerid] = 1;
                                    
ArrestingPlayer[targetid] = playerid;
                                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}C.I.A AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                                    
format(stringsizeof(string), "~W~AN ~B~C.I.A AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                                    
GameTextForPlayer(targetidstring40005);
                                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] C.I.A AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                                    
SendClientMessage(playeridredstring);
                                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                                    return 
1;
                                }
                            }
                            if(
PoliceTeam(GetPlayerSkin(playerid)))
                            {
                                if(
GetPlayerWantedLevel(targetid) >= 4)
                                {
                                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                                    
TryingArrested[playerid] = 1;
                                    
ArrestingPlayer[targetid] = playerid;
                                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}OFFICERAGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                                    
format(stringsizeof(string), "~W~AN ~B~OFFICER AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                                    
GameTextForPlayer(targetidstring40005);
                                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] OFFICER AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                                    
SendClientMessage(targetidredstring);
                                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                                    
SendClientMessage(playeridredstring);
                                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                                    return 
1;
                                }
                            }
                        }
                    }
                }
            }
            return 
1;

__________________
RedRex's Cops and Robbers
RCNR Soon
We are working on it. Just wait us!! Soon updating to hosted tap after finished.
RedRex is offline   Reply With Quote
Old 11/09/2019, 07:11 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,064
Reputation: 50
Default Re: Not working... no errors / warrings..

PHP Code:
if (newkeys KEY_FIRE
This is enough, no need to use
PHP Code:
 && !(oldkeys KEY_LOOK_BEHIND
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 11/09/2019, 11:48 AM   #3
RedRex
Huge Clucker
 
RedRex's Avatar
 
Join Date: Jan 2016
Location: Portugal <3
Posts: 496
Reputation: 29
Default Re: Not working... no errors / warrings..

Ok Bro Look at... The Cops when pressing MMB they did not tell them anything... I mean They should told them if no one close them they must say: There are no player near you. But When The Cops pressing MMB They got nothing why?

PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],string[128], rangepass 0;
    new 
Float:XFloat:YFloat:Z;
    foreach(new 
targetid:Player)
    if ((
newkeys KEY_LOOK_BEHIND))
    {
        if(!
PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
        {
            if (!
IsPlayerInRangeOfPoint(playerid5.0XYZ)) return SendClientMessage(playeridRED"{FF0000}Error: {FFFFFF}There are close player near you.");
            { 
__________________
RedRex's Cops and Robbers
RCNR Soon
We are working on it. Just wait us!! Soon updating to hosted tap after finished.
RedRex is offline   Reply With Quote
Old 11/09/2019, 11:53 AM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,064
Reputation: 50
Default Re: Not working... no errors / warrings..

PHP Code:
if(!PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid))) 
this line is totally wrong and needs to be deleted.

in loop, you're using RETURN which is stopping code to be executed for next player.
there are a logical errors.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 11/09/2019, 12:17 PM   #5
RedRex
Huge Clucker
 
RedRex's Avatar
 
Join Date: Jan 2016
Location: Portugal <3
Posts: 496
Reputation: 29
Default Re: Not working... no errors / warrings..

So What actually I can do?
__________________
RedRex's Cops and Robbers
RCNR Soon
We are working on it. Just wait us!! Soon updating to hosted tap after finished.
RedRex is offline   Reply With Quote
Old 11/09/2019, 12:23 PM   #6
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,064
Reputation: 50
Default Re: Not working... no errors / warrings..

well, it's quite complicated, too many checkers and a big loop, I think this might resolve issue
PHP Code:
                    if(!IsPlayerConnected(targetid)) continue;
                    if(!
IsPlayerInRangeOfPoint(playerid5.0XYZ)) continue;
                    if(
playerid == targetid) continue;
                    if(
PlayerInfo[targetid][pJailed] == 1) return SendClientMessage(playeridred"{FF0000}Error: This player is already in jail, you can't arrest them.");
                    if(
IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,red,"{FF0000}Error: You can't arrest players if they're in a vehicle.");
                    if(
GetPlayerWantedLevel(targetid) <= 3) return SendClientMessage(playeridred"{FF0000}Error: You can't arrest players with a wanted level lower than 4. Use /tk to issue a ticket, or press 2.");
                    if(
GetPlayerWantedLevel(targetid) == 0) return SendClientMessage(playeridred"{FF0000}Error: This player is not wanted, you can't arrest them");
                    if(
PlayerHasTakenDamage[playerid] == targetid) return SendClientMessage(playeridRED"[WARRING]: YOU CANNOT ARREST THIS PLAYER BECAUSE HE SHOOTED YOU..."); 
out of loop
PHP Code:
                    if(GetPlayerInterior(playerid) > 0) return SendClientMessage(playeridred"{FF0000}Error: You can't arrest players inside an interior.");
                    if(
GetPVarInt(playerid,"ArTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"{FF0000}Error: Please wait 5 seconds before arresting a suspect again."); 
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 11/09/2019, 07:18 PM   #7
RedRex
Huge Clucker
 
RedRex's Avatar
 
Join Date: Jan 2016
Location: Portugal <3
Posts: 496
Reputation: 29
Default Re: Not working... no errors / warrings..

Ok hey @Mugala, I've edit the code and I got 0 erros / 0 warrings but It's not working yet why?

Here is the full code...
PHP Code:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],string[128], rangepass 0;
    new 
Float:XFloat:YFloat:Z;
    foreach(new 
targetid:Player)
    if ((
newkeys KEY_LOOK_BEHIND))
    {
      if(!
PoliceTeam(GetPlayerSkin(playerid)) && !SWAT(GetPlayerSkin(playerid)) && !Army(GetPlayerSkin(playerid)) && !FBII(GetPlayerSkin(playerid)) && !CIA(GetPlayerSkin(playerid)))
      {
        if(!
IsPlayerInRangeOfPoint(playerid5.0XYZ)) continue;
           if(!
IsPlayerConnected(targetid)) continue;
         if(
playerid == targetid) continue;
          if(
IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,red,"{FF0000}Error: {FFFFFF}You can't arrest players if they're in a vehicle.");
           if(
GetPlayerWantedLevel(targetid) <= 3) return SendClientMessage(playeridred"{FF0000}Error: You can't arrest players with a wanted level lower than 4. Use /tk to issue a ticket, or press 2.");
        if(
GetPlayerWantedLevel(targetid) == 0) return SendClientMessage(playeridred"{FF0000}Error: This player is not wanted, you can't arrest them");
        {
            if(
PoliceTeam(GetPlayerSkin(playerid)))
            {
                if(
GetPlayerWantedLevel(targetid) >= 4)
                {
                      
rangepass++;
                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                     
TryingArrested[playerid] = 1;
                      
ArrestingPlayer[targetid] = playerid;
                       
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}S.W.A.T AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                    
format(stringsizeof(string), "~W~AN ~B~S.W.A.T AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                    
GameTextForPlayer(targetidstring40005);
                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] S.W.A.T AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                    
SendClientMessage(playeridredstring);
                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                    return 
1;
                }
            }
            if(
Army(GetPlayerSkin(playerid)))
            {
                if(
GetPlayerWantedLevel(targetid) >= 4)
                {
                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                       
TryingArrested[playerid] = 1;
                      
ArrestingPlayer[targetid] = playerid;
                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}A.R.M.Y AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                     
SendClientMessage(targetidredstring);
                      
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                       
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                    
format(stringsizeof(string), "~W~AN ~P~ARMY AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                    
GameTextForPlayer(targetidstring40005);
                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] A.R.M.Y AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                    
SendClientMessage(playeridredstring);
                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                    return 
1;
                }
            }
            if(
FBII(GetPlayerSkin(playerid)))
            {
                if(
GetPlayerWantedLevel(targetid) >= 4)
                {
                    
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                       
TryingArrested[playerid] = 1;
                    
ArrestingPlayer[targetid] = playerid;
                      
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}F.B.I AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                     
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                      
format(stringsizeof(string), "~W~AN ~B~F.B.I AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                       
GameTextForPlayer(targetidstring40005);
                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] F.B.I AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                    
SendClientMessage(playeridredstring);
                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                    return 
1;
                }
            }
            if(
CIA(GetPlayerSkin(playerid)))
               {
                  if(
GetPlayerWantedLevel(targetid) >= 4)
                  {
                     
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                    
TryingArrested[playerid] = 1;
                      
ArrestingPlayer[targetid] = playerid;
                    
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}C.I.A AGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                     
SendClientMessage(targetidredstring);
                      
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                       
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                       
format(stringsizeof(string), "~W~AN ~B~C.I.A AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                    
GameTextForPlayer(targetidstring40005);
                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] C.I.A AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                    
SendClientMessage(playeridredstring);
                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                    return 
1;
                }
            }
            if(
PoliceTeam(GetPlayerSkin(playerid)))
               {
                  if(
GetPlayerWantedLevel(targetid) >= 4)
                 {
                       
SecondsToJail[targetid] = SetTimerEx("JailPlayer",5000,0,"i",targetid);
                      
TryingArrested[playerid] = 1;
                    
ArrestingPlayer[targetid] = playerid;
                     
format(stringsizeof(string), "{0080FF}[BEING ARRESTED]: {FFFFFF}OFFICERAGENT %s(%d) has put {ADFF2F}handcuffs {FFFFFF}on you."pNameplayerid);
                      
SendClientMessage(targetidredstring);
                       
SetPlayerAttachedObject(targetid9194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                    
SetPlayerSpecialAction(targetidSPECIAL_ACTION_CUFFED);
                    
format(stringsizeof(string), "~W~AN ~B~OFFICER AGENT %s(%d) ~W~HAS CUFFED YOU!!~n~~b~TYPE [/BC] TO ESCAPE FROM THE ~Y~CUFFS"pNameplayerid);
                    
GameTextForPlayer(targetidstring40005);
                    
format(stringsizeof(string), "{33B5FF}[BEGIN ARREST!!!] OFFICER AGENT %s(%d) is trying to arrest you!! {33B5FF}Use /BC for escape from this arrest!!"pNameplayerid);
                    
SendClientMessage(targetidredstring);
                    
format(stringsizeof(string), "{ffffff}You have placed {0080FF}%s(%d) {FFFFFF}in handcuffs for an arrest. Use {0080FF}/search (id) {FFFFFF}to search them for illegal Drugs."tNametargetid);
                    
SendClientMessage(playeridredstring);
                    
SetPVarInt(playerid,"ArTime",GetTickCount()+5000);
                    return 
1;
                    }
           }
           else
           {
                
SendClientMessage(playeridRED"{FF0000}Error: {FFFFFF}There are close player near you.");
                return 
1;
           }
        }
      }
    }
     return 
1;

It must be like: When some cops press MMB and there are no player close him they must send him a message but it's not work..
__________________
RedRex's Cops and Robbers
RCNR Soon
We are working on it. Just wait us!! Soon updating to hosted tap after finished.
RedRex is offline   Reply With Quote
Old 12/09/2019, 10:42 AM   #8
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,064
Reputation: 50
Default Re: Not working... no errors / warrings..

add debugs to see why it's not working, it's quite big code to look in details.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala 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
5 WARRINGS RedRex Scripting Help 2 23/02/2016 12:02 PM
Getting MySQL errors but Server is Working cosmean Scripting Help 2 04/01/2016 08:42 PM
No errors , no warnings - just not working Dziugsas Scripting Help 18 08/12/2014 02:23 PM
There is no errors in this script, but it's not working InGame. Kethrios Scripting Help 10 20/11/2012 01:17 AM
Help please! Infinite NOS aint working! (but no errors either) Kitten_Blind Help Archive 9 26/11/2010 02:19 PM


All times are GMT. The time now is 01:01 AM.


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