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). 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 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 )
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
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 (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
This one can for example be used when first spawning the user to set it’s current level/xp
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
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:
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
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):
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
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
Variables and Settings
This script doesn't have much settings (variables) since it doesn't need to, it currently hasXNL_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
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
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 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
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
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”
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”
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
@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):