24.10.2018, 11:24 
	
	
	PHP код:
CMD:toggle(playerid, params[])
{
    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]", settings, info);
    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(string, sizeof(string), "* %s yes. ", PlayerName(playerid));
      ProxDetector(30, playerid, string, COLOR_PURPLE);
      }
     if(pInfo[playerid][rChat] == 1)
    {
    pInfo[playerid][rChat] = 1;
     format(string, sizeof(string), "* %s not. ", PlayerName(playerid));
      ProxDetector(30, playerid, string, COLOR_PURPLE);
    return 1;
    }
}
    return 1;
} 
If I type /toggle PM nothing happens.






