Could you help?
#1

Could you help me to make a command to enable/disable the rob able instead of the "waittumer" like /enablerob
Thank you.
PHP код:
//Command(s)
CMD:robbank(playeridparams[])
{
    if(
robpossible == 1
    {
        if(
IsPlayerInRangeOfPoint(playerid3.02309.1899,-8.4444,26.7422))
        {
            
robpossible 0
            
SetTimer("waittimer"300000false); //Normal Mode 5 minutes
           
            //SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
            
SetTimer("robtimer"60000false);
        
            
            
SendClientMessage(playeridCOLOR_WHITE"You are robbing the bank, the police has been notified!");
            
SendClientMessage(playeridCOLOR_WHITE"You gotta stay 30 seconds in the bank in order to rob it!");
         }
    } else {
        
SendClientMessage(playeridCOLOR_WHITE"You can't rob the bank right now!");
    }
    return 
1;

Reply
#2

PHP код:
CMD:robbank(playeridparams[]) 

    if(
robpossible == 1)  
    { 
        if(
IsPlayerInRangeOfPoint(playerid3.02309.1899,-8.4444,26.7422)) 
        { 
            
robpossible 0;  
            
SetTimer("waittimer"300000false); //Normal Mode 5 minutes 
            
            //SetTimer("waittimer", 65000, false); //Test Mode 65 seconds 
            
SetTimer("robtimer"60000false); 
         
             
            
SendClientMessage(playeridCOLOR_WHITE"You are robbing the bank, the police has been notified!"); 
            
SendClientMessage(playeridCOLOR_WHITE"You gotta stay 30 seconds in the bank in order to rob it!"); 
         } 
         else
            return 
SendClientMessage(playeridCOLOR_WHITE"You have to be near the rob-point to start robbing.");
    } 
    else 
    { 
        
SendClientMessage(playeridCOLOR_WHITE"You can't rob the bank right now!"); 
    } 
    return 
1
}  
CMD:togglerob(playeridparams[])
{
    if(
Check if this guy is Admin//Eg: pInfo[playerid][Admin] > 4
    
{
        new 
msgx[128]
        if(
robpossible == 0)
        {
            
format(msgxsizeof(msgx), "%s has enabled bank robing. Use /robbank at the bank to start robbing."PlayerName(playerid));
            
robpossible 1;
        }
        else
        {
            
format(msgxsizeof(msgx), "%s has disabled bank robing."PlayerName(playerid));
            
robpossible 0;
        }
        return 
SendClientMessageToAll(COLOR_IMPORTANTmsgx);
    }
    return 
SendClientMessage(playeridCOLOR_WHITE"You are not authorized to use this command.");

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)