SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 12/02/2019, 12:02 AM   #11
Freaksken's Avatar
Join Date: Mar 2009
Location: Belgium
Posts: 556
Reputation: 352
Default Re: Experience bar

Originally Posted by Volumen View Post
Yes, because if you are level 1, then to go up to level 2 you need 12 of xp, and if you are level 2 you need 24 of xp to go up to level 3 and so on. Everything depends on the level of the player.

"PLAYER_LEVEL [playerid] * 12" is equal to 12 of "xp" needed to go up to level 2. In this case, the variable 'PLAYER_LEVEL [playerid]' of the player is '1' because it is his initial level.
Then the formula I gave works exactly as I told you.
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.

[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Old 12/02/2019, 02:00 AM   #12
Beta Tester
Y_Less's Avatar
Join Date: Jun 2008
Location: 629 -
Posts: 15,710
Reputation: 3226
Default Re: Experience bar

The formula assumes floats, which they may not be. Integer division will give nought in almost all cases here. Remove the brackets to fix it.
Y_Less is offline   Reply With Quote
Old 12/02/2019, 04:39 PM   #13
Little Clucker
Join Date: Dec 2018
Posts: 47
Reputation: 0
Default Re: Experience bar

I don't understand what it says. The previous formula did not work for me, I had to do it this way:

PHP Code:
new test PLAYER_LEVEL[playerid] * 12;
Float:size 514.0 floatmul(floatdiv(PLAYER_EXP[playerid], test), 90.0); 
Volumen is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
First experience on SA-MP. Lordzy Everything and Nothing 87 19/06/2013 03:48 PM
Help Experience Saw® Scripting Help 11 23/06/2012 01:40 AM
Experience bar jorambo Help Archive 5 17/07/2011 01:44 PM
experience Dainyzxz Help Archive 1 18/03/2010 12:53 PM
experience bar [ALEX] Help Archive 1 30/01/2010 11:02 AM

All times are GMT. The time now is 05:41 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.