Command doesn't work.
#4

Quote:
Originally Posted by Ermanhaut
Посмотреть сообщение
pawn Код:
// pPM must be changed to bool:pPM = true and so on...

CMD:toggle(playerid, params[]) {

  static settings[24], info[24];
  if(!sscanf(params, "s[24]s[24]", settings, info) {

    if(!strcmp(settings, "pm", true) {

      pInfo[playerid][pPM] = !pInfo[playerid][pPM]; // This makes the value switch. (true becomes false, false becomes true)
      if(pInfo[playerid][pPM]) return SendClientMessage(playerid, -1, "Now you're getting PMs!");
      else return SendClientMessage(playerid, -1, "Now you're not getting PMs.");
    }
   
    else if(!strcmp(settings, "testerchat", true)) {

      pInfo[playerid][tChat] = !pInfo[playerid][tChat];
      if(pInfo[playerid][pPM]) return SendClientMessage(playerid, -1, "Now you'll read the Tester Chat!");
      else return SendClientMessage(playerid, -1, "Now you're reading the Tester Chat.");
    }
   
    else return SendClientMessage(playerid, -1, "The option typed in wasn't found.");
  }
 
  else return SendClientMessage(playerid, -1, "Use /toggle [Function]."),
    SendClientMessage(playerid, -1, "Options: PM, TesterChat, AdminChat, Radio");
}
You shouldn't spoonfeed code. The guy is no longer going to learn anything from you doing that. Also, the statement you made about the bools aren't necessarily true considering that 0 = false and 1 = true. It will, however, prevent mentions of compiler warnings if you are using the community pawn-lang compiler, first maintained by zeex.
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: 4 Guest(s)