sscanf "u" specifier makes problems
#3

Quote:
Originally Posted by Jimmy0wns
View Post
Would you mind showing the ShowStats function?
here is the function:
Code:
stock ShowStats(playerid, playerb)
{
	new string[256], gender[8];
	// Gender
	if(PlayerInfo[playerb][pGender] == 1) format(gender, sizeof(gender), "Male");
	else if(PlayerInfo[playerb][pGender] == 2) format(gender, sizeof(gender), "Female");
	// Health and Armor
	new Float:HP,Float:Armor;
	GetPlayerHealth(playerb, HP);
	GetPlayerArmour(playerb, Armor);
	// Loyal
	new loyal[4];
	if(!PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "Yes");
	if(PlayerInfo[playerb][pLoyal]) format(loyal, sizeof(loyal), "No");
	// Oldskool
	new oldskool[4];
	if(PlayerInfo[playerb][pHours] >= 248) format(oldskool, sizeof(oldskool), "Yes");
	else if(PlayerInfo[playerb][pHours] < 248) format(oldskool, sizeof(oldskool), "No");
	//fac-fam rank
	new rank[128];
	if(PlayerInfo[playerb][pFac] >= 1) format(rank, sizeof(rank), "%s", RPFRN(playerb));
	else format(rank, sizeof(rank), "None");
	//fac-fam
	new org[128];
	if(PlayerInfo[playerb][pFac] >= 1) format(org, sizeof(org), "%s", RPFNEx(playerb));
	else format(org, sizeof(org), "None");
	//
	new rank2[128];
	if(PlayerInfo[playerb][pFam] >=1) format(rank2, sizeof(rank2), "%s", RPFaRN(playerb));
	else format(rank2, sizeof(rank2), "None");
	//fac-fam
	new org2[128];
	if(PlayerInfo[playerb][pFam] >=1) format(org2, sizeof(org2), "%s", RPFaN(playerb));
	else format(org2, sizeof(org2), "None");
	new exp = PlayerInfo[playerb][pExp];
	new nxtlevel = PlayerInfo[playerb][pLevel]+1;
	new expamount = nxtlevel*4;
	//new costlevel = nxtlevel*4000;//10k for testing purposes
	//respect
	new respectneed[4];
	if(PlayerInfo[playerb][pLevel] == 1) format(respectneed, sizeof(respectneed), "4");
 	else if(PlayerInfo[playerb][pLevel] == 2) format(respectneed, sizeof(respectneed), "8");
  	else if(PlayerInfo[playerb][pLevel] == 3) format(respectneed, sizeof(respectneed), "12");
   	else if(PlayerInfo[playerb][pLevel] == 4) format(respectneed, sizeof(respectneed), "16");
    else if(PlayerInfo[playerb][pLevel] == 5) format(respectneed, sizeof(respectneed), "20");
    else if(PlayerInfo[playerb][pLevel] == 6) format(respectneed, sizeof(respectneed), "24");
    else if(PlayerInfo[playerb][pLevel] == 7) format(respectneed, sizeof(respectneed), "28");
    else if(PlayerInfo[playerb][pLevel] == 8) format(respectneed, sizeof(respectneed), "32");
    else if(PlayerInfo[playerb][pLevel] == 9) format(respectneed, sizeof(respectneed), "36");
    else if(PlayerInfo[playerb][pLevel] == 10) format(respectneed, sizeof(respectneed), "40");
    else if(PlayerInfo[playerb][pLevel] == 11) format(respectneed, sizeof(respectneed), "44");
    else if(PlayerInfo[playerb][pLevel] == 12) format(respectneed, sizeof(respectneed), "48");
    else if(PlayerInfo[playerb][pLevel] == 13) format(respectneed, sizeof(respectneed), "52");
    else if(PlayerInfo[playerb][pLevel] == 14) format(respectneed, sizeof(respectneed), "56");
    else if(PlayerInfo[playerb][pLevel] == 15) format(respectneed, sizeof(respectneed), "60");
    else if(PlayerInfo[playerb][pLevel] == 16) format(respectneed, sizeof(respectneed), "64");
    else if(PlayerInfo[playerb][pLevel] == 17) format(respectneed, sizeof(respectneed), "68");
    else if(PlayerInfo[playerb][pLevel] == 18) format(respectneed, sizeof(respectneed), "72");
    else if(PlayerInfo[playerb][pLevel] == 19) format(respectneed, sizeof(respectneed), "76");
    else if(PlayerInfo[playerb][pLevel] == 20) format(respectneed, sizeof(respectneed), "80");
    else if(PlayerInfo[playerb][pLevel] == 21) format(respectneed, sizeof(respectneed), "84");
    else if(PlayerInfo[playerb][pLevel] == 22) format(respectneed, sizeof(respectneed), "88");
    else if(PlayerInfo[playerb][pLevel] == 23) format(respectneed, sizeof(respectneed), "92");
    else if(PlayerInfo[playerb][pLevel] == 24) format(respectneed, sizeof(respectneed), "96");
    else if(PlayerInfo[playerb][pLevel] == 25) format(respectneed, sizeof(respectneed), "100");
    else if(PlayerInfo[playerb][pLevel] == 26) format(respectneed, sizeof(respectneed), "104");
    else if(PlayerInfo[playerb][pLevel] == 27) format(respectneed, sizeof(respectneed), "108");
    else if(PlayerInfo[playerb][pLevel] == 28) format(respectneed, sizeof(respectneed), "112");
    else if(PlayerInfo[playerb][pLevel] == 29) format(respectneed, sizeof(respectneed), "116");
    else if(PlayerInfo[playerb][pLevel] == 30) format(respectneed, sizeof(respectneed), "120");
    else if(PlayerInfo[playerb][pLevel] == 31) format(respectneed, sizeof(respectneed), "124");
    else if(PlayerInfo[playerb][pLevel] == 32) format(respectneed, sizeof(respectneed), "128");
    else if(PlayerInfo[playerb][pLevel] == 33) format(respectneed, sizeof(respectneed), "132");
    else if(PlayerInfo[playerb][pLevel] == 34) format(respectneed, sizeof(respectneed), "136");
    else if(PlayerInfo[playerb][pLevel] == 35) format(respectneed, sizeof(respectneed), "140");
    else if(PlayerInfo[playerb][pLevel] == 36) format(respectneed, sizeof(respectneed), "144");
    else if(PlayerInfo[playerb][pLevel] == 37) format(respectneed, sizeof(respectneed), "148");
    else if(PlayerInfo[playerb][pLevel] == 38) format(respectneed, sizeof(respectneed), "152");
    else if(PlayerInfo[playerb][pLevel] == 39) format(respectneed, sizeof(respectneed), "156");
    else if(PlayerInfo[playerb][pLevel] == 40) format(respectneed, sizeof(respectneed), "160");
	//new average = (PlayerInfo[playerb][pTMinutes] / PlayerInfo[playerb][pDay]);
	// Stats
	if(PlayerInfo[playerid][CardOwner])
	{
		format(string, sizeof(string), " -- LG-RP 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: [%.0f] - Armor: [%.0f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], BankInfo[playerb][Balance], HP, Armor);
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
		format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], exp, expamount, PlayerInfo[playerb][pExp]);
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
		format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kill: [%d] - Death: [%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] - Vehicles: 1[%s (ID:%d) - 2[%s (ID:%d)] - 3[%s (ID:%d)]", 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]);
		SendClientMessage(playerid, COLOR_RADIO, string);
		SendClientMessage(playerid, COLOR_REPORT, "** For information about your inventory use the '/inv' command.");
	}
	else
	{
		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: [You don't have Bank account] - Health: [%.0f] - Armor: [%.0f]", PlayerInfo[playerb][pLevel], gender, PlayerInfo[playerb][pAge], PlayerInfo[playerb][pMoney], HP, Armor);
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
		format(string, sizeof(string), "Phone Number: [%d] - Playing Hours: [%d] Next Level: [%d/%d] - Respect Points: [%d]", PlayerInfo[playerb][pNumber], PlayerInfo[playerb][pHours], exp, expamount, PlayerInfo[playerb][pExp]);
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
		format(string, sizeof(string), "Occupation: [%s] - Wanted Level: [%d] - Crimes Committed: [%d] - Arrested: [%dx] - Kill: [%d] - Death: [%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] - Vehicles: 1[%s (ID:%d) - 2[%s (ID:%d)] - 3[%s (ID:%d)]", 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]);
		SendClientMessage(playerid, COLOR_RADIO, string);
		SendClientMessage(playerid, COLOR_REPORT, "** For information about your inventory use the '/inv' command.");
	}
	return 1;
}
it works perfectly on any other ID then 0.
Reply


Messages In This Thread
sscanf "u" specifier makes problems - by maximthepain - 21.06.2015, 21:23
Re: sscanf "u" specifier makes problems - by Jimmy0wns - 21.06.2015, 21:29
Re: sscanf "u" specifier makes problems - by maximthepain - 21.06.2015, 21:33
Re: sscanf "u" specifier makes problems - by Crayder - 21.06.2015, 21:41
Re: sscanf "u" specifier makes problems - by maximthepain - 21.06.2015, 21:43
Re: sscanf "u" specifier makes problems - by Crayder - 21.06.2015, 21:48
Re: sscanf "u" specifier makes problems - by maximthepain - 21.06.2015, 21:49
Re: sscanf "u" specifier makes problems - by Konstantinos - 21.06.2015, 22:19
Re: sscanf "u" specifier makes problems - by Crayder - 21.06.2015, 22:28
Re: sscanf "u" specifier makes problems - by maximthepain - 21.06.2015, 22:38

Forum Jump:


Users browsing this thread: 3 Guest(s)