/badge for factions
#6

EDIT: Too slow, GG Konstantinos... GG.
Код:
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; 
}
Try this, what i saw was only faction id 3 could go off duty due to it only working in the case 3: instruction.
Reply


Messages In This Thread
/badge for factions - by CSLangdale - 16.04.2016, 09:42
Re: /badge for factions - by CSLangdale - 16.04.2016, 09:45
Re: /badge for factions - by Konstantinos - 16.04.2016, 09:55
Re: /badge for factions - by CSLangdale - 16.04.2016, 10:00
Re: /badge for factions - by Konstantinos - 16.04.2016, 10:09
Re: /badge for factions - by ghost556 - 16.04.2016, 10:16
Re: /badge for factions - by Prokill911 - 16.04.2016, 11:52

Forum Jump:


Users browsing this thread: 2 Guest(s)