Help Me Timer MixedUP
#1

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 ?
Reply
#2

What is the problem?
Reply
#3

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
Reply
#4

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

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
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)