• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Divide by zero
#1
Code:
ExpProgress(playerid)

{

? ? new Float:exp = playerData[playerid][pExp]*100/PlayerRequiredExp(playerid);

? ? return exp;

}



PlayerRequiredExp(playerid)

{

? ? new requiredexp = playerData[playerid][pLevel] * 2000;

return requiredexp;

}



pExp are always start from 0 when you're level up

So crashdetect always give me this?Run time error 11: "Divide by zero"

I need some idea how to get pass this one

I just want to popup exp to % but I need pExp to start by 0 when level up

Is that possible?
  Reply


Messages In This Thread
Divide by zero - by Zow - 2021-01-20, 06:02 PM
RE: Divide by zero - by RhaegarX - 2021-01-20, 06:55 PM

Forum Jump: