Commands not working properly
#6

How is it not shown? I re-looked the code in case I missed anything but the code is fine.

As for the toggling, an array to store whether the player is in duty or not is needed.
PHP код:
// global:
new gPlayer_OnDuty[MAX_PLAYERS];
// OnPlayerConnect:
gPlayer_Duty[playerid] = 0;
// unless you want the player to be automatically on duty or even after logging, set them to 1 where needed
CMD:aod(pidparams[]) 

    if(!
IsPlayerAdmin(pid)) return SCM(pidCOLOR_REDADMIN_MESSAGE); 
   
    new 
string[65], name[MAX_PLAYER_NAME]; 
    
GetPlayerName(pidnameMAX_PLAYER_NAME);
  
    if (!
gPlayer_Duty[playerid]) // not on duty
    
{
        
SPH(pid400); 
        
SetPlayerArmour(pid100); 
   
        
format(stringsizeof string"Admin %s is now on duty. /w him for help."name); 
        
SCMToAll(COLOR_LIMEstring); 
      
        
gPlayer_Duty[playerid] = 1// set them on duty
    
}
    else 
// on duty
    
{
          
// code for health/armour..
      
        
format(stringsizeof string"Admin %s is no longer on duty."name); 
        
SCMToAll(COLOR_LIMEstring); 
      
        
gPlayer_Duty[playerid] = 0;
    }
    return 
1

Reply


Messages In This Thread
Commands not working properly - by JXF - 21.05.2016, 16:33
Re: Commands not working properly - by justjamie - 21.05.2016, 16:36
Re: Commands not working properly - by Stinged - 21.05.2016, 16:37
Re: Commands not working properly - by Konstantinos - 21.05.2016, 16:41
Re: Commands not working properly - by JXF - 21.05.2016, 17:35
Re: Commands not working properly - by Konstantinos - 21.05.2016, 19:55
Re: Commands not working properly - by JXF - 21.05.2016, 20:27
Re: Commands not working properly - by Konstantinos - 21.05.2016, 20:32
Re: Commands not working properly - by JXF - 21.05.2016, 20:48

Forum Jump:


Users browsing this thread: 3 Guest(s)