29.01.2014, 10:40
Something weird is happening with my compiler, so I can't tell you if this gives errors or not.
Show us how you are USING the stats function, in a command? In a callback? If so, please show us the command/callback.
pawn Код:
stock ShowStats(playerid, playerb)
{
new string[150], gender[8], Float:H, Float:A, loyal[4], oldskool[4];
// Gender
format(gender, sizeof(gender), "%s", (PlayerInfo[playerb][pGender] == 1) ? ("Male") : ("Female"));
// Health and Armor
GetPlayerHealth(playerb, H);
GetPlayerArmour(playerb, A);
// Total Wealth
//new TotalWealth = PlayerInfo[playerb][pMoney] + PlayerInfo[playerb][pBank] + HouseInfo[PlayerInfo[playerb][pHouse]][hMoney] + BizInfo[PlayerInfo[playerb][pBiz]][bMoney];
// Loyal
format(loyal, sizeof(loyal), "%s", (PlayerInfo[playerb][pLoyal]) ? ("Yes") : ("No"));
// Oldskool
format(oldskool, sizeof(oldskool), "%s", (PlayerInfo[playerid][pHours] >= 24) ? ("Yes") : ("No"));
//fac-fam rank
new rank[20], org[20], rank2[20], org2[20];
format(rank, sizeof(rank), "%s", (PlayerInfo[playerb][pFac] >= 1) ? (RPFRN(playerb)) : ("None"));
format(org, sizeof(org), "%s", (PlayerInfo[playerb][pFac] >= 1) ? (RPFNEx(playerb)) : ("None"));
format(rank2, sizeof(rank2), "%s", (PlayerInfo[playerb][pFam] >= 1) ? (RPFaRN(playerb)) : ("None"));
format(org2, sizeof(org2), "%s", (PlayerInfo[playerb][pFam] >= 1) ? (RPFaN(playerb)) : ("None"));
/*//respect
new respectneed;
switch(PlayerInfo[playerb][pLevel])
{
case 1: respectneed = 4;
case 2: respectneed = 10;
case 3: respectneed = 18;
case 4: respectneed = 30;
case 5: respectneed = 42;
case 6: respectneed = 54;
case 7: respectneed = 70;
case 8: respectneed = 88;
case 9: respectneed = 108;
case 10: respectneed = 130;
case 11: respectneed = 154;
case 12: respectneed = 180;
case 13: respectneed = 208;
case 14: respectneed = 238;
case 15: respectneed = 270;
case 16: respectneed = 304;
case 17: respectneed = 340;
case 18: respectneed = 378;
case 19: respectneed = 418;
case 20: respectneed = 460;
case 21: respectneed = 504;
case 22: respectneed = 550;
case 23: respectneed = 598;
case 24: respectneed = 648;
case 25: respectneed = 700;
case 26: respectneed = 754;
case 27: respectneed = 810;
case 28: respectneed = 868;
case 29: respectneed = 928;
}*/
//new average = (PlayerInfo[playerb][pTMinutes] / PlayerInfo[playerb][pDay]);
//Stats
SendClientMessage(playerid, COLOR_LIGHTRED, "______________________________________________________");
format(string, sizeof(string), " Statistics of %s", RPN(playerb));
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Level: [%d] - Gender: [%s] - Age: [%d] - Money: [$%d] - Bank: [$%d] - Health: [%0.1f] - Armor: [%0.1f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], PlayerInfo[playerb][pBank], H, A);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Next Level Cost: [$%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], PlayerInfo[playerb][pExp], ((PlayerInfo[playerb][pLevel] + 1) * 4), ((PlayerInfo[playerb][pLevel] + 1) * 4000), PlayerInfo[playerb][pExp]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kills: [%d] - Deaths: [%d]", RPJN(playerb), PlayerInfo[playerb][pWanted], PlayerInfo[playerb][pCrimes], PlayerInfo[playerb][pArrested], PlayerInfo[playerb][pKill], PlayerInfo[playerb][pDeath]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "Faction: [%s] - Faction Rank: [%s] - Family: [%s] - Family Rank: [%s]", org, rank, org2, rank2);
SendClientMessage(playerid, COLOR_RADIO, string);
format(string, sizeof(string), "Business: [%s] - House: [%s] - Garage: [%s]", RBT(PlayerInfo[playerb][pBiz]), RPHK(playerb), RPGK(playerb), RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
SendClientMessage(playerid, COLOR_RADIO, string);
format(string, sizeof(string), "Vehicles: 1[%s (ID:%d)] - 2[%s (ID:%d)] - 3[%s (ID:%d)] - 4[%s (ID:%d)]", RVN(GetVehicleModel(PlayerInfo[playerb][pVeh])), PlayerInfo[playerb][pVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVeh])), PlayerInfo[playerb][pVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVeh])), PlayerInfo[playerb][pVVVeh], RVN(GetVehicleModel(PlayerInfo[playerb][pVVVVeh])), PlayerInfo[playerb][pVVVVeh]);
SendClientMessage(playerid, COLOR_RADIO, string);
return 1;
}