This Maths is wrong? or the Code?
#3

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)

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;
}
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
Reply


Messages In This Thread
This Maths is wrong? or the Code? - by DarrenReeder - 15.10.2010, 19:29
Re: This Maths is wrong? or the Code? - by Calgon - 15.10.2010, 19:48
Re: This Maths is wrong? or the Code? - by DarrenReeder - 15.10.2010, 20:00
Re: This Maths is wrong? or the Code? - by Babul - 15.10.2010, 20:39
Re: This Maths is wrong? or the Code? - by Simon - 15.10.2010, 21:43

Forum Jump:


Users browsing this thread: 1 Guest(s)