SA-MP Forums Archive
Help Me Timer MixedUP - 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: Help Me Timer MixedUP (/showthread.php?tid=554590)



Help Me Timer MixedUP - astanalol - 04.01.2015

Hello guys
today i made 2 Robing in 1 Commands i Changed Name Timer For 2 Rob To not Wait The Other store
now i done changed timer to can robing this after this but idk why he is telling me you cant robing now ?
PHP код:
CMD:rob(playeridparams[])
{
        if(
IsPlayerInRangeOfPoint(playerid4.0, -23.4826,-55.6319,1003.5469) && GetPlayerInterior(playerid) == 6)
        {
            if(
robbed[playerid] == 1) return SendClientMessage(playerid, -1"Wait before robbing again.");
            
robbed[playerid] = 1;
            
GameTextForPlayerplayerid"~g~Robbery in process~n~~r~Do not leave The Store!"300003);
            
SetTimerEx("robtimer"30000false"d"playerid);
            
SetTimerEx("robreset"180000false"d"playerid);
        }
        else if(
IsPlayerInRangeOfPoint(playerid4.0, -104.1407,-22.6708,1000.7188) && GetPlayerInterior(playerid) == 3)
        {
            if(
robbed[playerid] == 1) return SendClientMessage(playerid, -1"Wait before robbing again.");
            
robbed[playerid] = 1;
            
GameTextForPlayerplayerid"~g~Robbery in process~n~~r~Do not leave The Store!"300003);
            
SetTimerEx("SexShop"30000false"d"playerid);
            
SetTimerEx("SexShoprobreset"180000false"d"playerid);
        }
        else
        {
            
SendClientMessage(playerid, -1"You're not in the store / or Checkpoints.");
        }
        return 
1;
    } 
PHP код:
public SexShop(playerid)
    {
            if(
IsPlayerInRangeOfPoint(playerid1.0, -104.1407,-22.6708,1000.7188) && GetPlayerInterior(playerid) == 3)
            {
                new 
string[128];
                new 
cash random(200000);
                
GivePlayerMoney(playeridcash);
                
format(stringsizeof(string), "You have successfully robbed $%d from the SexShop!"cash);
                
SendClientMessage(playeridCOLOR_TWBLUEstring);
            }
                        else 
//otherwise
                        
{
                         
SendClientMessage(playerid, -1"Robbing failed, You left the store."); //he'll fail the robbing.
                         
}
            return 
1;
    }
public 
robtimer(playerid)
    {
            if(
IsPlayerInRangeOfPoint(playerid1.0, -23.4826,-55.6319,1003.5469) && GetPlayerInterior(playerid) == 6)
            {
                new 
string[128];
                new 
cash random(200000);
                
GivePlayerMoney(playeridcash);
                
format(stringsizeof(string), "You have successfully robbed $%d from the Seven!"cash);
                
SendClientMessage(playeridCOLOR_TWBLUEstring);
            }
                        else 
//otherwise
                        
{
                         
SendClientMessage(playerid, -1"Robbing failed, You left the store."); //he'll fail the robbing.
                         
}
            return 
1;
    }
public 
SexShoprobreset(playerid)
    {
        
SexShoprobbed[playerid] = 0;
        return 
1;
    }
public 
robreset(playerid)
    {
        
robbed[playerid] = 0;
        return 
1;
    } 
how to fix ?


Re: Help Me Timer MixedUP - ATGOggy - 04.01.2015

What is the problem?


Re: Help Me Timer MixedUP - astanalol - 04.01.2015

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
What is the problem?
the Timer i Changed it For 2 Robing
Now
When i /rob Seven i finish it and road the money
and goto sexshop to /rob
its tell me
PHP код:
Wait before robbing again 
i made the timer with diffrent name with 2 robing why its mix ?
how to fix it


Re: Help Me Timer MixedUP - ATGOggy - 04.01.2015

It'll display "Wait before robbing again" because of this variable:
PHP код:
robbed[playerid] = 1



Re: Help Me Timer MixedUP - ATGOggy - 04.01.2015

This will fix it:
PHP код:
CMD:rob(playeridparams[]) 

        if(
IsPlayerInRangeOfPoint(playerid4.0, -23.4826,-55.6319,1003.5469) && GetPlayerInterior(playerid) == 6
        { 
            if(
robbed[playerid] == 1) return SendClientMessage(playerid, -1"Wait before robbing again."); 
            
robbed[playerid] = 1
            
GameTextForPlayerplayerid"~g~Robbery in process~n~~r~Do not leave The Store!"300003); 
            
SetTimerEx("robtimer"30000false"d"playerid); 
            
SetTimerEx("robreset"180000false"d"playerid); 
        } 
        else if(
IsPlayerInRangeOfPoint(playerid4.0, -104.1407,-22.6708,1000.7188) && GetPlayerInterior(playerid) == 3
        { 
            if(
SexShoprobbed[playerid] == 1) return SendClientMessage(playerid, -1"Wait before robbing again."); 
            
SexShoprobbed[playerid] = 1
            
GameTextForPlayerplayerid"~g~Robbery in process~n~~r~Do not leave The Store!"300003); 
            
SetTimerEx("SexShop"30000false"d"playerid); 
            
SetTimerEx("SexShoprobreset"180000false"d"playerid); 
        } 
        else 
        { 
            
SendClientMessage(playerid, -1"You're not in the store / or Checkpoints."); 
        } 
        return 
1
    }