public GetPlayerRank(playerid)
#4

Remove:
pawn Код:
forward GetPlayerRank(playerid);
public GetPlayerRank(playerid)
{
    new ranktext[64];
    new faction = PlayerInfo[playerid][pFaction];
    switch(faction)
    {
        case 1:
        {
            if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Sheriff"; }
            else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Undersheriff"; }
            else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Assistant Sheriff"; }
            else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Captain"; }
            else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Lieutenant"; }
            else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Sergeant"; }
            else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Corporal"; }
            else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Deputy Sheriff II"; }
            else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Deputy Sheriff I"; }
            else if(PlayerInfo[playerid][pRank] == 10) { ranktext = "Deputy Sheriff Generalist"; }
            else { ranktext = "Civilian Field Assistant"; }
        }
        case 2:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Fire Chief"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Deputy Chief"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Assistant Chief"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Fire Captain"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Fire Lieutenant"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Supervisor"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Fire Fighter II"; }
                else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Fire Fighter I"; }
                else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Probationary FireFighter"; }
                else { ranktext = "Probationary FireFighter"; }
        }
        case 3:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "EMS Supervisor"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Part-time Supervisor"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "EMS Team Leader"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "EMT-P"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "EMT-B"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "EMT Student"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Attendant"; }
                else { ranktext = "Attendant"; }
        }
        case 4:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Race Leader"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Race Underleader"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Pro Racer"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Race Technician"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Outside Racer"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Track Tester"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Beginner"; }
                else { ranktext = "Unknown"; }
        }
        case 5:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Commissioner"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Deputy Commissioner"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Assistant Commissioner"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Captain"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Lieutenant"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Staff Sergeant"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Sergeant"; }
                else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Corporal"; }
                else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Senior Correction Officer"; }
                else if(PlayerInfo[playerid][pRank] == 10) { ranktext = "Correction Officer"; }
                else { ranktext = "Contract Worker"; }
        }
        case 6:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Chief of Police"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Assistant Chief of Police"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Commander"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Captain"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Lieutenant"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Sergeant III"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Sergeant II"; }
                else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Sergeant I"; }
                else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Senior Lead Officer"; }
                else if(PlayerInfo[playerid][pRank] == 10) { ranktext = "Police Officer III"; }
                else if(PlayerInfo[playerid][pRank] == 11) { ranktext = "Police Officer II"; }
                else if(PlayerInfo[playerid][pRank] == 12) { ranktext = "Police Officer I"; }
                else { ranktext = "Police Officer I"; }
        }
    }
    return ranktext; //you're returning a string, not a integer :)
}
Add:
pawn Код:
stock GetPlayerRank(playerid)
{
    new ranktext[64];
    new faction = PlayerInfo[playerid][pFaction];
    switch(faction)
    {
        case 1:
        {
            if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Sheriff"; }
            else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Undersheriff"; }
            else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Assistant Sheriff"; }
            else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Captain"; }
            else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Lieutenant"; }
            else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Sergeant"; }
            else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Corporal"; }
            else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Deputy Sheriff II"; }
            else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Deputy Sheriff I"; }
            else if(PlayerInfo[playerid][pRank] == 10) { ranktext = "Deputy Sheriff Generalist"; }
            else { ranktext = "Civilian Field Assistant"; }
        }
        case 2:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Fire Chief"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Deputy Chief"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Assistant Chief"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Fire Captain"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Fire Lieutenant"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Supervisor"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Fire Fighter II"; }
                else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Fire Fighter I"; }
                else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Probationary FireFighter"; }
                else { ranktext = "Probationary FireFighter"; }
        }
        case 3:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "EMS Supervisor"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Part-time Supervisor"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "EMS Team Leader"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "EMT-P"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "EMT-B"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "EMT Student"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Attendant"; }
                else { ranktext = "Attendant"; }
        }
        case 4:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Race Leader"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Race Underleader"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Pro Racer"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Race Technician"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Outside Racer"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Track Tester"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Beginner"; }
                else { ranktext = "Unknown"; }
        }
        case 5:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Commissioner"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Deputy Commissioner"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Assistant Commissioner"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Captain"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Lieutenant"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Staff Sergeant"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Sergeant"; }
                else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Corporal"; }
                else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Senior Correction Officer"; }
                else if(PlayerInfo[playerid][pRank] == 10) { ranktext = "Correction Officer"; }
                else { ranktext = "Contract Worker"; }
        }
        case 6:
        {
                if(PlayerInfo[playerid][pRank] == 1) { ranktext = "Chief of Police"; }
                else if(PlayerInfo[playerid][pRank] == 2) { ranktext = "Assistant Chief of Police"; }
                else if(PlayerInfo[playerid][pRank] == 3) { ranktext = "Commander"; }
                else if(PlayerInfo[playerid][pRank] == 4) { ranktext = "Captain"; }
                else if(PlayerInfo[playerid][pRank] == 5) { ranktext = "Lieutenant"; }
                else if(PlayerInfo[playerid][pRank] == 6) { ranktext = "Sergeant III"; }
                else if(PlayerInfo[playerid][pRank] == 7) { ranktext = "Sergeant II"; }
                else if(PlayerInfo[playerid][pRank] == 8) { ranktext = "Sergeant I"; }
                else if(PlayerInfo[playerid][pRank] == 9) { ranktext = "Senior Lead Officer"; }
                else if(PlayerInfo[playerid][pRank] == 10) { ranktext = "Police Officer III"; }
                else if(PlayerInfo[playerid][pRank] == 11) { ranktext = "Police Officer II"; }
                else if(PlayerInfo[playerid][pRank] == 12) { ranktext = "Police Officer I"; }
                else { ranktext = "Police Officer I"; }
        }
    }
    return ranktext; //you're returning a string, not a integer :)
}
Reply


Messages In This Thread
public GetPlayerRank(playerid) - by Gecko75 - 12.10.2013, 14:19
Re: public GetPlayerRank(playerid) - by EiresJason - 12.10.2013, 14:22
Re: public GetPlayerRank(playerid) - by Gecko75 - 12.10.2013, 14:40
Re: public GetPlayerRank(playerid) - by EiresJason - 12.10.2013, 15:07
Re: public GetPlayerRank(playerid) - by Gecko75 - 12.10.2013, 15:32
Re: public GetPlayerRank(playerid) - by EiresJason - 12.10.2013, 15:32

Forum Jump:


Users browsing this thread: 1 Guest(s)