stats bugged.
#1

so seems like i'm having a problem with /stats


the test line is what i typed. not a cmd.

Showstats stock:
pawn Код:
stock showstats(playerid, playerb)
{
  new string[128];
  SendClientMessage(playerid, COLOR_LGREEN, "Your stats:");
  format(string, sizeof(string), "Score: [%d] - Rank: [%s] - Cash: [%d] - Kills: [%d] - Deaths: [%d]", PlayerInfo[playerb][pScores], RNS(playerid), PlayerInfo[playerb][pCash], PlayerInfo[playerb][pKills], PlayerInfo[playerb][pDeaths]);
  SendClientMessage(playerid, -1, string);
  return 1;
}
Rank stock:
pawn Код:
stock RNS(playerid)
{
    new name[128];
    if(PlayerInfo[playerid][pScores] > 561800) format(name, sizeof(name), "General");
    else if(PlayerInfo[playerid][pScores] > 349800) format(name, sizeof(name), "Lieutenant General");
    else if(PlayerInfo[playerid][pScores] > 212000) format(name, sizeof(name), "Major General");
    else if(PlayerInfo[playerid][pScores] > 137800) format(name, sizeof(name), "Colonel");
    else if(PlayerInfo[playerid][pScores] > 85200) format(name, sizeof(name), "Lieutenant Colonel");
    else if(PlayerInfo[playerid][pScores] > 52600) format(name, sizeof(name), "Major");
    else if(PlayerInfo[playerid][pScores] > 32600) format(name, sizeof(name), "Captain");
    else if(PlayerInfo[playerid][pScores] > 20000) format(name, sizeof(name), "First Lieutenant");
    else if(PlayerInfo[playerid][pScores] > 12600) format(name, sizeof(name), "Second Lieutenant");
    else if(PlayerInfo[playerid][pScores] > 7400) format(name, sizeof(name), "Command Sergeant Major");
    else if(PlayerInfo[playerid][pScores] > 5200) format(name, sizeof(name), "Sergeant Major");
    else if(PlayerInfo[playerid][pScores] > 3200) format(name, sizeof(name), "First Sergeant");
    else if(PlayerInfo[playerid][pScores] > 2000) format(name, sizeof(name), "Staff Sergeant");
    else if(PlayerInfo[playerid][pScores] > 1200) format(name, sizeof(name), "Sergeant");
    else if(PlayerInfo[playerid][pScores] > 800) format(name, sizeof(name), "Corporal");
    else if(PlayerInfo[playerid][pScores] > 400) format(name, sizeof(name), "Specialist");
    else if(PlayerInfo[playerid][pScores] > 50) format(name, sizeof(name), "Private First Class");
    else if(PlayerInfo[playerid][pScores] > 0) format(name, sizeof(name), "Private");
    else if(PlayerInfo[playerid][pScores] == 0) format(name, sizeof(name), "Private");
    return 1;
}
Reply
#2

in your stock,you change the return 1; to return name;
Reply
#3

Omfg, i feel so stupid lol hahaha, totally forgot about that XD
Rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)