16.04.2016, 11:52
Some nasty ass code above.
You're making a switch which isn't even needed..
Above code will do the exact same.. Just shorter and cleaner
PHP код:
CMD:badge(playerid, params[]) {
if(pInfo[playerid][Faction] != 1 || pInfo[playerid][Faction] != 2) {
return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not authorized to use this command!");
}
if(pDuty[playerid] == 0) {
pDuty[playerid] = 1;
SendClientMessage(playerid, COLOR_WHITE, "You are now on Duty");
SetPlayerColor(playerid, COLOR_RED);
} else {
pDuty[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You are now off Duty");
SetPlayerColor(playerid, COLOR_WHITE);
}
return 1;
}
Above code will do the exact same.. Just shorter and cleaner