Levels-XP System

Gameplay Addons
Post Reply
User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

Levels-XP System

#1

Post by Raheem » 2 Years Ago

Levels-XP System

Description:
  • Level-XP system for our Mod. Player need to earn XP so his level go up. Optimized version and many new things have been inserted.
Cvars:
  • ze_zombie_infect 3 How much XP zombie get for infecting Human?
  • ze_escape_success 5 How much XP Human get for Escaping?
  • ze_enable_dmg 1 Enable damage XP? 0 = Disable | 1 = Enable
  • ze_required_dmg 50.0 Damage Required so Player get XP?
  • ze_dmg_award 3 How much XP Human get for make the Required damage?
  • ze_start_xp 50 How much XP new Player get (His first time to enter the server)?
  • ze_max_xp_first_level 100 First Level XP needed?
  • ze_maxlevels_increment 2 XP needed increment Rate.
  • ze_enable_percentage_style 1 Enable To display XP as Percentage? 0 = Disable | 1 = Enable
  • ze_new_level_zero_xp 0 When Player get new Level start his XP from Zero? 0 = No | 1 = Yes
  • ze_add_commas_to_xp 1 Enable add commas if you use number mode not percentage? 0 = Disable | 1 = Enable
  • ze_levels_save_type 0 Saving type, 1 = MySQL | 0 = nVault
  • ze_levels_host "127.0.0.1" MySQL host.
  • ze_levels_user "root" MySQL username have all permissions to database.
  • ze_levels_pass "password" MySQL username password.
  • ze_levels_dbname "levels_db" MySQL database name.
Natives (API):
  • ze_get_user_xp(id) This will return the XP the player have. id is the player Index.
  • ze_set_user_xp(id, iXP) Set player XP. id is the player index. iXP is the XP amount to set.
  • ze_get_user_level(id) This will return the player level. id is the player Index
  • ze_set_user_level(id, iLevel) This will set the player level. id is Player Index. iLevel is the level to give.
  • ze_get_user_max_xp(id) This will return the XP needed for the next Level for this player. id is the Player index.
  • ze_set_user_max_xp(id, iMaxXP) To set Max XP for player. id - Player index, iMaxXP is XP to set.
Forwards (API):
  • ze_on_levelup(id) Called on everytime a player levels up, id is player index.
Installation & Instructions:
  • Simply install it like any plugin nothing new but don't forget to copy the sound folder also.
  • You can change the Hud Message Colors and Position from the Defines in the code. So you will need to Re-Compile the plugin again after editing.

    1. // Messages
    2. const Float:HUD_SPECT_X = -1.0
    3. const Float:HUD_SPECT_Y = 0.70
    4. const Float:HUD_STATS_X = -1.0
    5. const Float:HUD_STATS_Y = 0.90
    6.  
    7. const HUD_STATS_ZOMBIE_R = 200
    8. const HUD_STATS_ZOMBIE_G = 220
    9. const HUD_STATS_ZOMBIE_B = 0
    10.  
    11. const HUD_STATS_HUMAN_R = 0
    12. const HUD_STATS_HUMAN_G = 200
    13. const HUD_STATS_HUMAN_B = 210
    14.  
    15. const HUD_STATS_SPEC_R = 100
    16. const HUD_STATS_SPEC_G = 100
    17. const HUD_STATS_SPEC_B = 100
  • You can change the Level UP sound as you need.
  • If you enabled Percentage Style this mean that instead of Displaying: XP: 500/1000 it will display: XP 50.00 %
  • MaxLevels Increment is a rate that control how much XP needed for the next Level. So for Example if you set the First Level XP to 100 then when player connect he will have 0/100 XP The increment rate works like: 0/200 XP, 0/400 XP, 0/800 XP It will Multiply the needed XP in the factor you set. The factor can take the float form like: 1.5, 0.5, 1.2, 1.55 And so on.
  • If you enable start xp from zero so when player get new level his XP will be zero. And if you used Percentage mode so it will be 0.0 %
  • Commas will be added only if you use normal mode not Percentage one.
  • If you need this system to work properly with No-Steam/Non-Steam Clients which their games not generate unique SteamID so in reunion.cfg edit these two Cvars cid_NoSteam47, cid_NoSteam48 to be like: cid_NoSteam47 = 3, cid_NoSteam48 = 3.
  • Rank/Top System for Level-System: Here.
  • All ideas are welcomed, Any bug please report.

Changelog:
  • Spoiler!
    Version: 1.0
    • First Release.
    Version: 1.1
    • Added Check levels if ze_set_user_xp() native used.
    • Added New Cvar determine if Player XP should start from zero or not when he get new level.
    • Added Commas Cvar.
    • Added XP/MaxXP if one Spec other.
    Version: 1.2
    • Fixed player can go higher levels very fast.
    Version: 1.3
    • Added Auto detection for Non-Steam (STEAM_ID_LAN & VALVE_ID_LAN) users and save thier XP, Levels by their name. Normal players who have steamid it will be saved with steamid.
    Version: 1.4
    • Fixed some problems.
    • Added new cvar to save XP, Levels every X seconds.
    • Added new Rank System like /top15
    Version: 1.5
    • Added /myrank like default one in amxmodx but here for levels.
    • Replace any multi-byte character with space.
    • Fixed Saving & Loading Problems.
    • Added support in /lvlrank and /myrank for Non-Steam users.
    • Fixed giving XP at end round. Now it will give only alive humans only.
    • Added cvar to control Screen Fade/Shake effects.
    • Added new native to return max xp needed for next level.
    • Fixed problem in set level native.
    • Rank players in same levels with their XP. Highest XP will be first.
    • Some optimizations.
    Version: 1.6
    • Use nVault to be compatible with our ZE v1.2 and to solve resetting levels issue.
    Version: 1.7
    • Removed Rank/Top systems.
    • Temporary Fix for losing Levels, XP Inserted like coins system fix.
    • Removed support for "STEAM_ID_LAN/VALVE_ID_LAN".
    Version: 1.8
    • Fixed nVault saving issue.
    • Changed the Coding style.
    • Recoded natives, added explanation for natives in .inc file. Check Natives API.
    Version: 1.9 [Current Version]
    • Inserted MySQL support.
    • Added new forward that called when player levels up.

Screenshots:
  • ImageImageImageImageImage
Downloads:
These users thanked the author Raheem for the post (total 2):
Mohamed Alaa (2 Years Ago) • Muhammet20 (3 Months Ago)
You don't know? Learn and you will know.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#2

Post by johnnysins2000 » 2 Years Ago

nice and i think u already have share this on ZPPV?


Anyway i wanted to request u that When will u update the ze mod ?

what i am trying to say is that can u also put the Vip model and admin model code in the main sma just like zp has it ?
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#3

Post by Raheem » 2 Years Ago

All old works are out-dated and badly coded and no one will support it. All the new works here are coded highly with experience.

You can use it as separate plugin in the next updates it won't be integrated with them. Just to know why >> Because our mod is already multi-sources we need to make things easier not harder so i'am not going to integrate it.
You don't know? Learn and you will know.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#4

Post by johnnysins2000 » 2 Years Ago

I see what u trying to say is that u want to make seperate sma just like zp50 so it will be easier to edit for the scripters who want to change them as well! Ok then i will use that plugin

Nice Work

I Will wait for the ze vip plugin update
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#5

Post by Raheem » 2 Years Ago

This what we already done in all the mod.

About the VIP plugin updates i'll make after i finish some important things first.
You don't know? Learn and you will know.

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#6

Post by Raheem » 2 Years Ago

New version Released.
Current Version Now: 1.1
You don't know? Learn and you will know.

User avatar
sam_bhosale4
Mod Tester
Mod Tester
India
Posts: 109
Joined: 2 Years Ago
Location: INDIA
Has thanked: 5 times
Been thanked: 2 times
Age: 21
Contact:

#7

Post by sam_bhosale4 » 2 Years Ago

I installed It Yesterday.. 7 players were playing!
It worked for me fine,like level up xp gain and all.. but for others they were leveling up on each round also I get normally LEVEL 0: 59/100 in hud but others get LEVEL 0:5/1 like this and they level up each round! Having this big problem because everyone is leveling up each round which is bad..Please fix it raheem bro!
Thanks!
-=SeRious-GaminG|Zombie Escape[Alien vs. Predator]|Asia=-
206.189.132.169:40000
Image

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#8

Post by johnnysins2000 » 2 Years Ago

sam_bhosale4 wrote:
2 Years Ago
I installed It Yesterday.. 7 players were playing!
It worked for me fine,like level up xp gain and all.. but for others they were leveling up on each round also I get normally LEVEL 0: 59/100 in hud but others get LEVEL 0:5/1 like this and they level up each round! Having this big problem because everyone is leveling up each round which is bad..Please fix it raheem bro!
Thanks!
Post pictures To Show Your Problem clearly

Change the Cvars from the code

But still show The pictures So I can understand what is Your Problem

I think Your problem Is with cvars


Raheem has Showed Two types of HUD

One is XP : %
One is XP : In Numbers
Nobody Is That Busy If They Make Time :roll:

User avatar
sam_bhosale4
Mod Tester
Mod Tester
India
Posts: 109
Joined: 2 Years Ago
Location: INDIA
Has thanked: 5 times
Been thanked: 2 times
Age: 21
Contact:

#9

Post by sam_bhosale4 » 2 Years Ago

johnnysins2000 wrote:
2 Years Ago
sam_bhosale4 wrote:
2 Years Ago
I installed It Yesterday.. 7 players were playing!
It worked for me fine,like level up xp gain and all.. but for others they were leveling up on each round also I get normally LEVEL 0: 59/100 in hud but others get LEVEL 0:5/1 like this and they level up each round! Having this big problem because everyone is leveling up each round which is bad..Please fix it raheem bro!
Thanks!
Post pictures To Show Your Problem clearly

Change the Cvars from the code

But still show The pictures So I can understand what is Your Problem

I think Your problem Is with cvars


Raheem has Showed Two types of HUD

One is XP : %
One is XP : In Numbers
no bro read it again what i said!
its not with cvar!
im using xp in number where for first level it should show LEVEL 0: 0/100 but instead because of some problem for others it shows LEVEL 0:0/0 or 5/0..
also on each round it levels up like if 1st round ends the players goes level 2 if 2nd round ends players goes level 3 and so on..
and i dont have screenshots sorry since other players of my server reported this problem to me!
-=SeRious-GaminG|Zombie Escape[Alien vs. Predator]|Asia=-
206.189.132.169:40000
Image

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#10

Post by johnnysins2000 » 2 Years Ago

sam_bhosale4 wrote:
2 Years Ago
johnnysins2000 wrote:
2 Years Ago
sam_bhosale4 wrote:
2 Years Ago
I installed It Yesterday.. 7 players were playing!
It worked for me fine,like level up xp gain and all.. but for others they were leveling up on each round also I get normally LEVEL 0: 59/100 in hud but others get LEVEL 0:5/1 like this and they level up each round! Having this big problem because everyone is leveling up each round which is bad..Please fix it raheem bro!
Thanks!



Post pictures To Show Your Problem clearly

Change the Cvars from the code

But still show The pictures So I can understand what is Your Problem

I think Your problem Is with cvars


Raheem has Showed Two types of HUD

One is XP : %
One is XP : In Numbers
no bro read it again what i said!
its not with cvar!
im using xp in number where for first level it should show LEVEL 0: 0/100 but instead because of some problem for others it shows LEVEL 0:0/0 or 5/0..
also on each round it levels up like if 1st round ends the players goes level 2 if 2nd round ends players goes level 3 and so on..
and i dont have screenshots sorry since other players of my server reported this problem to me!
They Only Reported to you? And U believe Them?
Ask Them to show screenshot it will make Your Problem look Clear and understandable.... Although I never Faced the problem What u said wait for Raheem to reply Maybe he knows What is Your Problem

Maybe other players are getting xp fast That's why they are leveling up fast

Notice one Thing Man the cvars

U get xp for doING 50 damage and for infecting and Killing so I still think u must change cvars and call those players and test again
Nobody Is That Busy If They Make Time :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest