SA-MP Forums Archive
Hey again! Same Problem! - 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: Hey again! Same Problem! (/showthread.php?tid=653542)



Hey again! Same Problem! - Thanks - 06.05.2018

Hello This command is worked only for first Player joined! If someone joined after Him! he can't use this command Why??

I wan't this command for all CIVILIAN worked not only for 1person!! How?
PHP код:
CMD:breakcuff(playerid, params[])
{
     if(
PoliceTeam(GetPlayerSkin(playerid))) return SendClientMessage(playerid, -1, "{ff0000}Error: {Ffffff}Only Civilian can use this comamnd.");
     {
     new 
targetid;
     if(
BeginArrested[targetid] == 1 && Civilian(GetPlayerSkin(targetid)))
     {
            
KillTimer(BeginArrestedTime[targetid]);
            
SendClientMessage(targetid, -1, "{FF7000}YOU HAVE BEEN ESCAPED FROM ARRESTED!!! RUN RUN !!!!");
            
SetPlayerWantedLevel(targetid, 3);
            
SetPlayerColor(targetid, YELLOW);
            
GameTextForPlayer(targetid, "~Y~ESCAPED FROM ~G~ARRESTED ~P~ RUN BABY!!!", 7000, 5);
            
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
            
BeginArrested[targetid] = 0;
      }
            else if 
SendClientMessage(targetid, -1, "{FF0000}Error: {FFFFFF}You can use this command only while be cuffed or arrested.");
            }
    return 
1;
} 



Re: Hey again! Same Problem! - Sielly - 06.05.2018

What happens when second player use this command?

edit:
targetid is always 0. You didnt set it any value. You have to check params and then set targetid value.

I am not sure how do you want this command works, but try this:

PHP код:
CMD:breakcuff(playerid, params[]) 
{ 
     if(
PoliceTeam(GetPlayerSkin(playerid)))
        return 
SendClientMessage(playerid, -1, "{ff0000}Error: {Ffffff}Only Civilian can use this comamnd."); 
    
     if(
BeginArrested[playerid] == 1 && Civilian(GetPlayerSkin(playerid))) 
     { 
            
KillTimer(BeginArrestedTime[playerid]); 
            
SendClientMessage(playerid, -1, "{FF7000}YOU HAVE BEEN ESCAPED FROM ARRESTED!!! RUN RUN !!!!"); 
            
SetPlayerWantedLevel(playerid, 3); 
            
SetPlayerColor(playerid, YELLOW); 
            
GameTextForPlayer(playerid, "~Y~ESCAPED FROM ~G~ARRESTED ~P~ RUN BABY!!!", 7000, 5); 
            
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE); 
            
BeginArrested[playerid] = 0; 
      }else{
            
SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}You can use this command only while be cuffed or arrested."); 
      } 
    return 
1; 
} 



Re: Hey again! Same Problem! - kovac - 06.05.2018

Hi again you using the same shitty system? I bet that you'll get many bugs if you continue this way.
https://sampforum.blast.hk/showthread.php?tid=653381


Re: Hey again! Same Problem! - Thanks - 08.05.2018

Quote:
Originally Posted by Sielly
Посмотреть сообщение
What happens when second player use this command?

edit:
targetid is always 0. You didnt set it any value. You have to check params and then set targetid value.

I am not sure how do you want this command works, but try this:

PHP код:
CMD:breakcuff(playerid, params[]) 
{ 
     if(
PoliceTeam(GetPlayerSkin(playerid)))
        return 
SendClientMessage(playerid, -1, "{ff0000}Error: {Ffffff}Only Civilian can use this comamnd."); 
    
     if(
BeginArrested[playerid] == 1 && Civilian(GetPlayerSkin(playerid))) 
     { 
            
KillTimer(BeginArrestedTime[playerid]); 
            
SendClientMessage(playerid, -1, "{FF7000}YOU HAVE BEEN ESCAPED FROM ARRESTED!!! RUN RUN !!!!"); 
            
SetPlayerWantedLevel(playerid, 3); 
            
SetPlayerColor(playerid, YELLOW); 
            
GameTextForPlayer(playerid, "~Y~ESCAPED FROM ~G~ARRESTED ~P~ RUN BABY!!!", 7000, 5); 
            
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE); 
            
BeginArrested[playerid] = 0; 
      }else{
            
SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}You can use this command only while be cuffed or arrested."); 
      } 
    return 
1; 
} 
Thank you so much It's worked now <3

Quote:
Originally Posted by kovac
Посмотреть сообщение
Hi again you using the same shitty system? I bet that you'll get many bugs if you continue this way.
https://sampforum.blast.hk/showthread.php?tid=653381
Thank you for trying to help me.