Faction rank problem
#8

Hello!

Write it so:
PHP код:
stock GetFactionRankName(playerid)
{
    new 
rankname[30];
    switch(
pInfo[playerid][Faction])
    {
        case 
1:
        {
            
//Faction 1
            
if(!pInfo[playerid][FactionRank])strcat(rankname,"Police Officer I");
            else if(
pInfo[playerid][FactionRank] == 1)strcat(rankname,"Police Officer II");
            else if(
pInfo[playerid][FactionRank] == 2)strcat(rankname,"Police Officer III");
            else if(
pInfo[playerid][FactionRank] == 3)strcat(rankname,"Lead Police Officer");
            else if(
pInfo[playerid][FactionRank] == 4)strcat(rankname,"Sergeant I");
            else if(
pInfo[playerid][FactionRank] == 5)strcat(rankname,"Sergeant II");
            else if(
pInfo[playerid][FactionRank] == 6)strcat(rankname,"Sergeant III");
            else if(
pInfo[playerid][FactionRank] == 7)strcat(rankname,"Lieutenant I");
            else if(
pInfo[playerid][FactionRank] == 8)strcat(rankname,"Lieutenant II");
            else if(
pInfo[playerid][FactionRank] == 9)strcat(rankname,"Lieutenant III");
            else if(
pInfo[playerid][FactionRank] == 10)strcat(rankname,"Captain I");
            else if(
pInfo[playerid][FactionRank] == 11)strcat(rankname,"Captain II");
            else if(
pInfo[playerid][FactionRank] == 12)strcat(rankname,"Captain III");
            else if(
pInfo[playerid][FactionRank] == 13)strcat(rankname,"Commander");
            else if(
pInfo[playerid][FactionRank] == 14)strcat(rankname,"Assistant Chief of Police");
            else if(
pInfo[playerid][FactionRank] == 15)strcat(rankname,"Deputy Chief of Police");
            else if(
pInfo[playerid][FactionRank] == 16)strcat(rankname,"Chief of Police");
            return 
rankname;
        }
    }
    return 
1;
}
CMD:r(playerid,params[])
{
    new 
string[145],pName[MAX_PLAYER_NAME],factionid pInfo[playerid][Faction];
    if(!
factionid)return SendClientMessage(playeridCOLOR_LIGHTRED"SERVER:{FFFFFF} You're not in a faction!");
    
GetPlayerName(playerid,pname,sizeof pname);
    
format(string,sozeof string,"%s %s: %s",GetFactionRankName(playerid),pname,params);
    
SendFactionRadioMessage(factionid,string);
    return 
1;

Do you get errors?

Mencent
Reply


Messages In This Thread
Faction rank problem - by izeatfishz - 09.04.2015, 15:06
Re: Faction rank problem - by ]Rafaellos[ - 09.04.2015, 15:38
Re: Faction rank problem - by izeatfishz - 09.04.2015, 15:41
Re: Faction rank problem - by izeatfishz - 09.04.2015, 16:03
Re: Faction rank problem - by Dignity - 09.04.2015, 16:08
Re: Faction rank problem - by izeatfishz - 09.04.2015, 16:25
Re: Faction rank problem - by izeatfishz - 09.04.2015, 17:42
AW: Faction rank problem - by Mencent - 09.04.2015, 17:51
Re: Faction rank problem - by izeatfishz - 09.04.2015, 18:01
AW: Faction rank problem - by Mencent - 09.04.2015, 18:05

Forum Jump:


Users browsing this thread: 1 Guest(s)