SA-MP Forums Archive
How to add Timer for this robbery - 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: How to add Timer for this robbery (/showthread.php?tid=608033)



How to add Timer for this robbery - Recardo - 26.05.2016

I Try to add Timer and No ERRORS / Warrings but its dosn't work ! Can u help me to fix it ? and Add

40 Secdons For Robbery

PHP код:
CMD:robisle(playeridparams[])
{
    if(
GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playeridRED"Only civilians can rob places.");
    if(
IsRobbingIsle{playerid} == true) return SendClientMessage(playeridRED"Your already robbing the joint.");
    if(
IsPlayerHoldingAGun(playerid) == || HasBeenCuffed{playerid} == true) return SendClientMessage(playeridRED"You must be holding a gun to rob places.");
    if((
gettime() - 120) < TimerInfo[playerid][CMD_timer16]) return SendClientMessage(playeridRED"Please wait before using this command again.");
    
TimerInfo[playerid][CMD_timer16] = gettime();
    new 
chance random(3);
    if(
chance == 0)
    {
        
format(fstrsizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob The Emerald Isle Casino at The Strip[North]"GetName(playerid), playerid);
        
CopRadio(BLUEfstr);
        
SendClientMessage(playeridRED"You have failed to rob The Emerald Isle Casino.");
        
GameTextForPlayer(playerid"~w~Robbery ~r~Failed"50005);
        
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid) + 4);
    }
    else if(
GetPlayerVirtualWorld(playerid) == && IsPlayerInRangeOfPoint(playerid,1.0,1139.7198,-4.0644,1000.6719))
    {
        if((
gettime() - 120) < islerobbed) return SendClientMessage(playeridRED"This place has been robbed recently, try again later.");
        
format(fstrsizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing The Emerald Isle Casino at The Strip[North]"GetName(playerid), playerid);
        
CopRadio(BLUEfstr);
        
SendClientMessage(playeridLIGHTGREEN"Your robbing The Emerald Isle Casino, DON'T LEAVE THE CHECKPOINT!");
        
GameTextForPlayer(playerid"~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint."250005);
        
SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        
IsRobbingIsle{playerid} = true;
        
isletimer{playerid} = SetTimerEx("IsleRob"25000false"d"playerid);
        
ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        
islerobbed gettime();
    }
    else
    {
        
SendClientMessage(playeridRED"Your not at the robbery checkpoint.");
    }
    new 
astring[100],pName[24];
    
GetPlayerName(playerid,(pName),sizeof(pName));
    
format(astring,sizeof(astring),"%s [%d] typed: /robisle",pName,playerid);
    
SendAdminMessage(GREY,astring);
    return 
true;




Re: How to add Timer for this robbery - Recardo - 26.05.2016

BOMMMMB?


Re: How to add Timer for this robbery - ilijap - 26.05.2016

How do you think its not working? And are you sure about this one :v? IsRobbingIsle{playerid} = true; Shouldn't that be IsRobbingIsle[playerid] = true; And dont forget to forward IsleRob. If your animation its not working preload it and define how its not working ...


Re: How to add Timer for this robbery - Dayrion - 26.05.2016

Show the public timer : IsleRob
Set him to 40000 instead of 25000.