16.04.2016, 10:16
EDIT: Too slow, GG Konstantinos... GG.
Try this, what i saw was only faction id 3 could go off duty due to it only working in the case 3: instruction.
Код:
CMD:badge(playerid, params[]) { if(pInfo[playerid][Faction] == 0 || pInfo[playerid][Faction] >= 3) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not authorized to use this command!"); switch(pInfo[playerid][Faction]) { case 1: { if(pInfo[playerid][Faction] == 1 && pDuty[playerid] == 0) { pDuty[playerid] = 1; SendClientMessage(playerid, COLOR_WHITE, "You are now on Duty"); SetPlayerColor(playerid, COLOR_PDRAD); } else if(pDuty[playerid] == 1) { pDuty[playerid] = 0; SendClientMessage(playerid, COLOR_WHITE, "You are now off Duty"); SetPlayerColor(playerid, COLOR_WHITE); } } case 2: { if(pInfo[playerid][Faction] == 2 && pDuty[playerid] == 0) { pDuty[playerid] = 1; SendClientMessage(playerid, COLOR_WHITE, "You are now on Duty"); SetPlayerColor(playerid, COLOR_RED); } else if(pDuty[playerid] == 1) { pDuty[playerid] = 0; SendClientMessage(playerid, COLOR_WHITE, "You are now off Duty"); SetPlayerColor(playerid, COLOR_WHITE); } } } return 1; }