16.04.2016, 09:55
Opened brackets do not match with the closed. Next time, try to indent your code properly so it'll be easier readable and avoids these issues:
PHP код:
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);
}
}
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);
}
}
case 3:
{
if(pInfo[playerid][Faction] >= 1 && pDuty[playerid] == 1)
{
pDuty[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You are now off Duty");
SetPlayerColor(playerid, COLOR_WHITE);
}
}
}
return 1;
}