24.10.2018, 11:48
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 not 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");
}