Help with equation?
#1

Hey, It's kinda late at night and i am tired, haha, So well in my code i have it so every time you kill someone you get 100 points, It's 1000 points to rank up, I have a variable to say how many points they have left before ranking up its name is "RankUpNeeded", I can't seem to figure out the equation you would need to establish how many 100's there are in a number, Can anyone help me out with this?, Cheers.

- LoneWolf23245
Reply
#2

1000 points is 10*100
(your equation you want sounds like this)
1000/100


so

equation

800 points means 200 to go

1000(levelup)
800(needed)
var1-var2 = amount left
Reply
#3

I have that, The idea is i want it to show how many kills you need before leveling up too, This is what i have so far:

Код:
CMD:points(playerid, params[])
{
	new PointsString1[128], PointsString2[128], RankUpNeeded;
	
	RankUpNeeded = PlayerInfo[playerid][PlayerPoints] - 1000;
	
	format(PointsString1, sizeof(PointsString1), "You currently have %d server points.", PlayerInfo[playerid][PlayerPoints]);
	format(PointsString2, sizeof(PointsString2), "You need %d more points before ranking up!.", RankUpNeeded);
	
	SendClientMessage(playerid, CommandSuccess, PointsString1);
	SendClientMessage(playerid, CommandError, PointsString2);
}
Now i need a way to figure out how many hundreds are in the variable 'RankUpNeeded' and echo it as amount of kills needed before rankup.
Reply
#4

ToBeShown = RankUpNeeded/100;

no??
Reply
#5

Quote:
Originally Posted by adsy
ToBeShown = RankUpNeeded/100;

no??
Worked thanks, Just tired is all xD
Reply
#6

its 2 am here, im tired too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)