/badge for factions
#7

Some nasty ass code above.
PHP код:
CMD:badge(playeridparams[]) {
    if(
pInfo[playerid][Faction] != || pInfo[playerid][Faction] != 2) {
        return 
SendClientMessage(playerid0x46E850FF"SERVER:{FFFFFF} You're not authorized to use this command!");
    }
    if(
pDuty[playerid] == 0) {
        
pDuty[playerid] = 1;
        
SendClientMessage(playeridCOLOR_WHITE"You are now on Duty");
        
SetPlayerColor(playeridCOLOR_RED);        
    } else {
        
pDuty[playerid] = 0;
        
SendClientMessage(playeridCOLOR_WHITE"You are now off Duty");
        
SetPlayerColor(playeridCOLOR_WHITE);
    }
    return 
1;

You're making a switch which isn't even needed..
Above code will do the exact same.. Just shorter and cleaner
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: 1 Guest(s)