15.10.2010, 20:00
It has been from 0-49 and its always 0...
Very strange (i even show the actual Value of the pGunSkill in my script when you use the /skills command)
EDIT:
i already realise there is a few problems with this code.. like when pGunSkill is on "50" it has no level..but dw about all the problems.. just need the percentage sorted
Very strange (i even show the actual Value of the pGunSkill in my script when you use the /skills command)
pawn Код:
CMD:skills(playerid, params[]){
if(playerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR] - Please log in first!");
new string[60], level, Float:percent;
SendClientMessage(playerid, COLOR_YELLOW, "---------------[Skills]---------------");
//Gun Dealer
if(playerStats[playerid][pGunSkill] < 50){ level = 1; percent = (playerStats[playerid][pGunSkill]/50)*100; }
else if(playerStats[playerid][pGunSkill] > 50 && playerStats[playerid][pGunSkill] < 150){ level = 2; percent = (playerStats[playerid][pGunSkill]/150)*100; }
format(string, sizeof(string), " * Gun Dealer Level: %d -- %f %s Completed (%d)", level, percent, "%%", playerStats[playerid][pGunSkill]);
SendClientMessage(playerid, COLOR_WHITE, string);
// Gun Dealer
SendClientMessage(playerid, COLOR_YELLOW, "---------------[Skills]---------------");
return 1;
}
i already realise there is a few problems with this code.. like when pGunSkill is on "50" it has no level..but dw about all the problems.. just need the percentage sorted