Command doesn't work.
#1

PHP код:
CMD:toggle(playeridparams[])
{
    if(
isnull(params))
    {
        
SendClientMessage(playerid, -1"Use /toggle [Function].");
        
SendClientMessage(playerid, -1"Options: PM, TesterChat, AdminChat, Radio");
        return 
1;
    }
    new 
settings[24], info[24], string[128];
    
sscanf(params"s[24]s[24]"settingsinfo);
    if(!
strcmp(settings"PM"true))
    {
    if(
pInfo[playerid][pPM] == 1)
    {
    
pInfo[playerid][pPM] = 0;
     
SendClientMessage(playerid,-1,""COL_LGREEN" Now you get PMs.");
    }
     if(
pInfo[playerid][pPM] == 1)
    {
    
pInfo[playerid][pPM] = 1;
     
SendClientMessage(playerid,-1,""COL_LGREEN" Now you don't get PMs.");
    }
    return 
1;
    }
    
    if(!
strcmp(settings"TesterChat"true))
    {
    if(
pInfo[playerid][tChat] == 1)
    {
    
pInfo[playerid][tChat] = 0;
     
SendClientMessage(playerid,-1,""COL_LGREEN" Activatedl.");
    }
     if(
pInfo[playerid][tChat] == 1)
    {
    
pInfo[playerid][tChat] = 1;
     
SendClientMessage(playerid,-1,""COL_LGREEN" not");
    }
    return 
1;
    }
    if(!
strcmp(settings"AdminChat"true))
    {
    if(
pInfo[playerid][aChat] == 1)
    {
    
pInfo[playerid][aChat] = 0;
     
SendClientMessage(playerid,-1,""COL_LGREEN" Yes.");
    }
     if(
pInfo[playerid][aChat] == 1)
    {
    
pInfo[playerid][aChat] = 1;
     
SendClientMessage(playerid,-1,""COL_LGREEN" Not");
    }
    return 
1;
    }
    
    if(!
strcmp(settings"Radio"true))
    {
    if(
pInfo[playerid][rChat] == 1)
    {
    
pInfo[playerid][rChat] = 0;
     
format(stringsizeof(string), "* %s yes. "PlayerName(playerid));
      
ProxDetector(30playeridstringCOLOR_PURPLE);
      }
     if(
pInfo[playerid][rChat] == 1)
    {
    
pInfo[playerid][rChat] = 1;
     
format(stringsizeof(string), "* %s not. "PlayerName(playerid));
      
ProxDetector(30playeridstringCOLOR_PURPLE);
    return 
1;
    }
}
    return 
1;

If I type in game /toggle it shows the options

If I type /toggle PM nothing happens.
Reply


Messages In This Thread
Command doesn't work. - by Zeus666 - 24.10.2018, 11:24
Re: Command doesn't work. - by Ermanhaut - 24.10.2018, 11:48
Re: Command doesn't work. - by Infin1ty - 24.10.2018, 11:49
Re: Command doesn't work. - by Infin1ty - 24.10.2018, 11:52
Re: Command doesn't work. - by Ermanhaut - 24.10.2018, 11:56
Re: Command doesn't work. - by Zeus666 - 24.10.2018, 12:16
Re: Command doesn't work. - by Undef1ned - 24.10.2018, 15:48
Re: Command doesn't work. - by Zeus666 - 24.10.2018, 19:26
Re: Command doesn't work. - by ReD_HunTeR - 24.10.2018, 19:34
Re: Command doesn't work. - by Zeus666 - 24.10.2018, 19:36

Forum Jump:


Users browsing this thread: 3 Guest(s)