[RELEASE] XNLRankBar ('Fully' working original GTA Rankbar / XP Bar NATIVELY! - with original GTA Levels!)

Considering to private message me? **READ THIS FIRST PLEASE!!** (Click here)

I will no longer reply to ‘mod related support questions’ in private messages.
Why not? Very simple: I took A LOT of time to make these mods availible for people to use, also took a lot of time to document them very well (both in the release page AND in the source code). Next to that i also tried to make sure that most of my releases are non conflicting as much as possible for >others (while i do NOT develop-to-release, i seriously make mods for myself because i like >programming a bit to much (it’s also my day job) :stuck_out_tongue: . So when i’m releasing them, I’m actually taking >extra effort in adapting the mods to be ‘universally usable’ for you guys and girls.

HOWEVER, 98% of the people whom private message me for ‘direct help/assistance’ ask questions which CLEARLY indicate that you don’t even take (or want to take) the effort to read a bit of text (the documentation i’ve wrote FOR YOU). So then sorry for all others, but this has made me decide to no longer help in private messages because that just takes up TO MUCH time for people whom do not take 5 minutes to just read the instructions and descriptions clearly.

Next to that lots of those private messages also expect “insane things” to be done for them like it’s nothing (Asking to ‘just make’ an entire framework for them, “just” make an whole custom database system including login etc etc).

Sure we all have to learn, just like i had yeaaaaaaaaaaaarrrrrsss ago, How i learned? by trying, trying, trying, reading, reading, reading, trying again, trying again, failing, reading more, trying again, analyzing other people’s codes as examples, trying again and then finally succeeding. From most (NOT ALL) people in private messages i get a strong feeling they want ‘the easy way’ of MAKING “your own” game server. Well fine, but if you want to make your own server, with it’s own unique functions. Then you’ll also need to learn and put some effort in. No offense or “bad” to anyone whom is really trying. But i really can’t (and don’t want to) take up any more of my private time (where i still try to help the serious learners though) to ‘help’ and/or ‘provide’ for ‘copy-paste’ server owners.

I seriously hope for all your understanding,
Cheers,
VenomXNL

**Want to use my code in PAID content?? NO!** (Click here)

!REUSING MY CODE/SAMPLES/SCRIPTS IN PAID CONTENT!
I’m NOT going to make an entire debate out of it, but: I DO NOT allow it if people want to use my scripts (updated/“modified” or not!) or parts of it to be “re-released” in PAID mods/scripts! I’m putting effort and time in it to make it available for FREE so others can enjoy it and learn from it. And honestly i personally find it disturbing that a community is ‘going to hell’ by making so many “paid mods”. As a professional developer I understand that people want to make some money on programming, but not like this. We can either make this great together and help each other or start competing “commercially” with each other and ruin it for everyone! My scripts are MUCH easier for me to “just NOT make them universal” for other (but directly intergrating them into my OWN framework instead). I however CHOOSE to make some of them usefull as external scripts for others to learn from… so NO you CAN NOT use them in your paid content! Now please stop asking that in my Private messages or on GH!

ANOTHER Edit (14-09-2020):
Seeing that to many people REFUSE to read and even take the effort to read the specs/description of this script/implementation, I will unfortunately have to put it here:

THIS SCRIPT DOES NOT!!! Save XP or Load XP to an database, neither will it give the option to ‘level lock’ items like weapons, cars, missions etc etc. This is “just” an GRAPHICAL INTERFACE.

It Re-introduces the GTA V/GTA Online rankbar back into FiveM, so you can use it with your OWN leveling system.

NOTE: ‘sorry’ if this part sounds harsh, but it’s also quite harsh and annoying if you put a lot of time in making a script in a way it’s usable for anyone (instead of just putting it in my own server), and then also to document it. And if people then refuse to read the documentation at least (it’s not that much effort), then it does get annoying after several dozens of times.

Extra tip: IF you even want to learn scripting, making your OWN server etc, then for *** sake start reading first :wink: You won’t become a decent scripter AT ALL if you don’t even read the documentation.

Last word on this part: If you don’t read the documentation, i will not even take the effort anymore to reply anymore (I have more to do than just replying to people whom are to lazy to read documentation).


Hey all,

I was looking for this function for a while but could only find some ‘DIY draw attempts’ and could not find good documentation on how to implement the original Rankbar. And considering that many servers or screenshots I’ve seen use a ‘custom screen draw’ to display the user level, xp or rank, I thought it was time to ‘re-create’ the original GTA Rank/XP bar without making own ‘screen draws’.

Especially since i’m (still) working on my own server where I want to give the ‘same feeling’ as the original game but with LOTS more functions, it was crucial for me to have the original bar functioning.

My RankBar script supports/includes the full original GTA Online ranks and their XP requirements!
(Not as in ‘unlocks’! but as in XP per level :wink: )

Mine supports normal “first spawn” popup with our without level animation,
it supports the ‘animated/rotating’ level globes during leveling up,
and as addition it also supports a ‘special color’ (red) when LOSING XP.

I have (just like my other resources) made it in a way that it’s (quite) easy to implement on your
own server or script(s), since I once again used 'standard “XNL Events/Functions” which are called and/or triggered. So that it’s compatible with all other gamemodes, scripts or frameworks.
This should also make implementation MUCH easier for every server :slight_smile:

Note: This script is 100% client sided (and can ofcourse be ‘extended’ by for example a ‘TriggerClientEvent’ addition for your own ‘serversided use’)

New In Version 1.1: The script now supports calling several functions from server-sided scripts and it now also exports the most important functions to make it even easier to interface with your own scripts :slight_smile: (The script still runs 100% client sided though, so no extra “server stress” from this script)

The code (client.lua) is also VERY GENEROUSLY commented for new scripters to explain (nearly)
every step that happens in the script.


Showcase/Demonstration

InitialSetupDuringSpawn
This one can for example be used when first spawning the user to set it’s current level/xp :slight_smile:
with the function:

CurrentXP = 3600
ShowRankBar = true
ShowRankBarAnimating = true
XNL_SetInitialXPLevels(CurrentXP, ShowRankBar, ShowRankBarAnimating )

New in version 1.1:
You can now also do this from the server/a server-sided script:
TriggerClientEvent('XNL_NET:XNL_SetInitialXPLevels', TargetClient , 3600, true, true)
NOTE: Make sure to set the correct target client ofcourse :wink:

Or you can call it from ANY other of your own scripts using the Export function:
‘exports.XNLRankBar:Exp_XNL_SetInitialXPLevels(3600, true, true)’


The next one is during gameplay and not only demonstrates the ‘level globe animation’ but also shows
that it’s (the animation) compatible with gaining multiple levels at once:
MultipleLevelsUpAnimation
Using this ‘style’ during gameplay is quite simple to call:

XPAmount = 5000
XNL_AddPlayerXP(XPAmount)

New in version 1.1:
You can now also do this from the server/a server-sided script:
TriggerClientEvent('XNL_NET:AddPlayerXP', TargetClient , 5000)
NOTE: Make sure to set the correct target client ofcourse :wink:

Or you can call it from ANY other of your own scripts using the Export function:
‘exports.XNLRankBar:Exp_XNL_AddPlayerXP(5000)’


Then we also have this ‘feature’ to remove XP (for example by an admin as “punishment” or
when you have a ‘prestige mode’ on your server):
TakingAwayXP
Which is equally as simple to use as the previous one:

XPAmount = 5000
XNL_RemovePlayerXP(XPAmount)

New in version 1.1:
You can now also do this from the server/a server-sided script:
TriggerClientEvent('XNL_NET:RemovePlayerXP', TargetClient , 5000)
NOTE: Make sure to set the correct target client ofcourse :wink:

Or you can call it from ANY other of your own scripts using the Export function:
‘exports.XNLRankBar:Exp_XNL_RemovePlayerXP(5000)’


Small side note on the the GIF/Demonstration images:
Keep in mind that any ‘graphical glitches’ or artifacts in the “Demo Images” are caused by the fact
that these are 'GIF Screen captures"! In the game itself it looks and animates 100% normally since this script uses the native game functions/files to create the rankbar :slight_smile:


Variables and Settings

This script doesn't have much settings (variables) since it doesn't need to, it currently has two three:
XNL_UseRedBarWhenLosingXP = true
XNL_MaxPlayerLevel = 500
XNL_EnableZKeyForRankbar = true	 -- <-- New in version 1.1!

Well the first one (obviously) sets if the bar should turn red when you’re losing XP,
and the second one is a level cap which is build in and you can set it to your server limit :slight_smile:
NOTE: The game itself is hard capped at level 7999

New in Version 1.1:
You can now press the [Z] key to make the Rankbar/XPBar show up on the HUD, BUT you can also change the line XNL_EnableZKeyForRankbar = true to false to disable this thread :slight_smile:


Test functions in my script

To make it easier to test the script i have included three RegisterCommand's for you:
/XNLSetBaseXPExample [AmountOfXP] 
/XNLAddXPExample [AmountOfXP]
/XNLRemoveXPExample [AmountOfXP]

Obviously you should remove/comment these commands when using the script!
Please do note that these command have minimal to no error checking and are just for YOU to
test/demonstrate the RankBar!


Build-in Functions and "Event Triggers"
The script also has some additional commands for you to use in your scripts and to make integration easier:

XNL_GetCurrentPlayerXP()    -- Will return the current (total) XP amount of the player (int)
XNL_GetCurrentPlayerLevel() -- Returns the current Level (int) (calculated from the XP amount automatically)
XNL_GetLevelFromXP(intXPAmount) -- Will 'Calculate' the intXPAmount given into the level it 'belongs to'

New in Version 1.1:
The functions above are now also available as Exports:

exports.XNLRankBar:Exp_XNL_GetCurrentPlayerXP()    -- Will return the current (total) XP amount of the player (int)
exports.XNLRankBar:Exp_XNL_GetCurrentPlayerLevel() -- Returns the current Level (int) (calculated from the XP amount automatically)
exports.XNLRankBar:Exp_XNL_GetLevelFromXP(intXPAmount) -- Will 'Calculate' the intXPAmount given into the level it 'belongs to'

New in Version 1.2:
These functions bellow are now (due to request) also available as Exports:

exports.XNLRankBar:Exp_XNL_GetXPFloorForLevel(LevelInt) -- Will calculate the floor level of XP for the given level nr.
exports.XNLRankBar:Exp_XNL_GetXPCeilingForLevel(LevelNr)  -- Will calculate the ceiling level of XP for the given level nr.

HOWEVER: If you do not know what you would use those two functions for, then you most likely don’t need them either :wink: In other words: Just don’t mess with these if you don’t exactly know what you’re doing, because these are NOT meant to set or get stats or to change settings. These are exports meant for developers whom would like to ‘hook onto’ my Rankbar and use the data from my ranking system!

The 'Event Triggers" it has are:

XNL_OnPlayerLevelUp()
XNL_OnPlayerLevelsLost()

These are both ‘function blocks’ which will be called when the player has either leveled up or lost level(s) due to receiving or losing XP. These functions are only called ONCE after giving or taking XP.
Which means that if you give the player 10.000XP at once and he/she level’s up multiple levels at once,
it will only be called/triggered once.

BUT if you give the player 10.000XP twice in a row then it will also trigger twice (IF the player also ranks up on both times of course).

NOTE: These are NOT exported or “server-triggers!” and ONLY work inside my script!


What does this script NOT do?

Well **it DOES NOT store/save or (re)load XP stats into databases or user statistics!** Why not? Well since many people use different frameworks, databases or 'user data processing' styles I wanted to make it compatible with all options and everyone, therefor you can easily modify and use the functions and 'EventTriggers' I've mentioned above to implement it in your server yourself :slight_smile:

But Venom, Will you make/adapt it for me so it saves the levels/XP on my server?
NOPE I will not, sorry! All scripts and ‘mods’ I’m releasing are made for my own custom and 100%
written from scratch server. And when it’s useful I will make or put it into an ‘additional’ script
so I can publish it for everyone to benefit from. I also test these scripts to see if they work
properly on a blank FiveM (skater) server before releasing.

BUT if i would try to make it compatible for all kinds of server types and databases, it would also
mean that I would have to install all those server types to test it (since I refuse to publish without testing it myself!).

Changing the ‘level globe’ color to bronze, silver, gold etc
And it DOES NOT change the color of the “level globes” when reaching level 100 for example.
I have tried figuring that our for a while but doesn’t seem to trigger/respond well, and thus I haven’t
found the correct calls yet. I MIGHT update it in the future if I find it or someone has that information
for me in the future. More information about this ‘issue’ can be found in the client.lua comments :slight_smile:

Framework or script intergration and re-publishing it while INCLUDED in it

However, on my Github (and thus download link) I have put conditions if someone would like to
make an ‘add-on’ or when someone wants to intergrate it into his/her/their framework.


Download

You can download the latest version (1.1) here at my Github

NOTE: Make sure not to drop the “ScreenShotExamples” folder onto your server when you
download the github repository :wink:


Version 1.1 Change-log:

  • Added Export Support so some functions are usable through external scripts
  • Added Client Net Events so server-sided scripts can call the three most important functions
  • Added the [Z] key support to show the Rankbar on hud by default now (can be disabled with variable setting)

Q: But where can I find the information about these new features?
A: In the topic itself I have added sections with “New In Version 1.1” :slight_smile:


Version 1.2 Change-log:

  • Added Export Support to two more functions for use through external scripts.
    These exports are however mainly intended for INTERFACE DEVELOPERS! If you’re “just” a server owner, scripter or are integrating it into your game(mode), then you most likely won’t need these two exports.

Q: But where can I find the information about these new features?
A: In the topic itself I have added sections with “New In Version 1.2” :slight_smile:

Q: Is there more documentation about those new exports?
A: Yes there is, in the source code with lots of comments, but yet again: If you are not sure what you would use them of or why you would need them… Then you probably don’t :wink:


@sixsens and @Jules_Lucas have ‘together’ worked out an example for ESX users whom want to implement it (including server sided code for use in your database):

48 Likes

Outstanding resource! Can’t wait to play around with this… Thanks for sharing :+1:

1 Like

Thank you very much man :slight_smile: I’ve made it as ‘easy as possible’ to integrate it properly for everyone :slight_smile:

I was really missing this ‘original game feature’ while developing my own server :slight_smile:

NOTE on the sample ‘gif’s’: The RankBar ingame DOES NOT have those ‘artifacts’ or ‘black dots’ and DOES animate smoothly, this is just due to the GIF encoding of-course :wink:

Whoops, i had messed up a line during uploading while copying it from my main script to the ‘release script’… Issue fixed :slight_smile:

While I won’t use something like this for my server as it doesn’t fit our needs, this is an absolutely fantastic release! Great job on this one :sunglasses:

1 Like

Thanks man :), I totally understand and respect that it will not fit everyone’s needs :slight_smile:
I however really want to try to ‘mimic’ the “real GTA:O” feeling while playing (no commands, normal key interactions etc).

I kinda have a “personal challenge” to make everything new, addon and expanded in my server “blend seamless” with the original game in a way that it would look and feel like it has always been there haha

:star_struck::heart_eyes::sunglasses: thx

1 Like

This is awesome!! we can implement it with something like… unlock-able items… or job ranks and events that can be triggered after certain level… daaamn… i love it hahahah

1 Like

@Sir_Smog1 & @Rapthor Thanks both for your appreciation :slight_smile:

@Rapthor indeed :slight_smile: , While most servers already use an XP and "unlock-able items’ system, as far as i KNOW (not 100% certain though! haha): Most (if not none) use the
actual original in game bar. This one uses the official game levels (XP requirements) and I indeed wanted something on my server like you said Rapthor: Unlockable jobs and such per level :slight_smile: while maintaining the “original game feeling” :slight_smile:

2 Likes

Just added a small 'extra" part to the main post (NOT UPDATED THE CODE! to keep it compatible for most players/users), which can also give you the ability to make it ‘pop up’ when players press the Z key :slight_smile:

check the "Small “Add-on” Edit / tip" section in the main post :slight_smile:

Neat resource - maybe an idea to use exports? :open_mouth:

1 Like

Thanks man, Yeah i was actually considering that after finishing the “standalone version to upload” (my ‘own’ is included in my own framework).

It Is/was mainly intended to merge with own game scripts for others, but might indeed be useful to update it with exports :slight_smile:

Although it can take some time before i have time again to do that (due to workload at my dayjob and limited scripting time) haha

Will definitely put it on the “To-do” :slight_smile: thanks for your feedback and input :slight_smile:

1 Like

Every time, I have a good idea, and than I see this :frowning_face:
Damn it. I need a new Idea!

Keep it Up, it looks awesome! :slight_smile:

Don’t worry, I think this will be a popular release. However, I server side implementation of this would be over the top. Keep up the good work!

Nice working script :] +1

1 Like

Well if you beaten me to it, it would have saved me time hahah,
On the other hand though :wink: :

I still can’t find the correct native calls to set the “Rank Globe” color :wink:
So if you can find that solution haha I will add it to the script with appropriate credits :wink: :stuck_out_tongue:

Thanks, BUT “totally” serversided isn’t possible however.

This is since the calls that are made are fully client related.
What CAN be done though is trigger events which are called from the server so that the server can trigger them in the client script :slight_smile:

I have unexpectedly some spare time now (while at the office hahaha), so I will implement some basic ‘addons’ for people to expand on and/or use it in other ways :slight_smile:

1 Like

UPDATED TO VERSION 1.1

@oganesson I managed to get some spare time at the office haha, so I’ve implemented export functions as suggested :slight_smile: (and of course credited you in the code for the suggestion :slight_smile: )

@createdbyeric I have also added (CLIENT!) NetEvents which can now be triggered by server-sided scripts :slight_smile:

All changes have been well documented again at the initial post :slight_smile:

1 Like

this is awesome.

I think ill find a way to give xp for online player…
soo they have xp per hour played.

Do you think there is a way?

5 Stars release. Great work my dude

1 Like