AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   OciXCrom's Rank System [XP|Levels|Ranks] (https://forums.alliedmods.net/showthread.php?t=308540)

OciXCrom 06-24-2018 14:38

OciXCrom's Rank System [XP|Levels|Ranks]
 

Description
  • A fully optimized and easy to use rank system, containing tons of options and an API for creating sub-plugins. Unlike other plugins like this where in order to add/remove or change ranks and the required XP for them, the end-user has to make changes in the .sma file and recompile the plugin, this one does everything through a configuration file that doesn't require any scripting skills nor recompiling the plugin after a change has been made. The plugin has an option to set different XP rewards for different in-game events, such as killing a player, headshot, suicide, teamkill, planting/defusing the bomb and so on. You can even specify different rewards for any weapon in the game.

Information
  • The plugin can be used in a game different than Counter-Strike. Bear in mind that the chat messages won't be colored when using another game.
  • It is also possible to have different settings for different maps. In order to do this, you need to write the map name between dashes on a new line in the configuration file (- de_dust2 -). This will make everything below this line be active only on that specific map. You can also use map prefixes (- de_* -). To go back to global settings, use - #all -.

Commands
  • /xp, /level -- shows your XP amount, level and rank (changeable in the .ini file)
  • /xplist -- opens a menu that shows online players' rank and XP (admins only)
  • /hudinfo -- enables/disables HUD information
  • crxranks_give_xp -- gives/takes XP to/from the player (admins only)
  • crxranks_reset_xp -- resets the player's XP (admins only)

Settings
  • CHAT_PREFIX -- prefix for chat messages
  • SAVE_TYPE -- how to save the XP (nick/IP/SteamID)
  • SAVE_INTERVAL -- when to save the XP (on disconnect/death/round end/XP update)
  • USE_MYSQL -- if set to 1, the plugin will use MySQL to save the XP, otherwise it will use nVault
  • SQL_HOST -- SQL address for use with MySQL
  • SQL_USER -- SQL user for use with MySQL
  • SQL_PASSWORD -- SQL password for use with MySQL
  • SQL_DATABASE -- SQL database for use with MySQL
  • SQL_TABLE -- SQL table for use with MySQL
  • VAULT_NAME -- name of the vault file where the XP is saved when using nVault
  • XP_COMMANDS -- commands that allow you to check your XP
  • LEVELUP_MESSAGE_TYPE -- who will see the message when a player reaches a new level
  • LEVELUP_SOUND -- sound when a player gains a level
  • LEVELUP_SCREEN_FADE_ENABLED -- whether the screen fade effect when a player gains a level will be active
  • LEVELUP_SCREEN_FADE_COLOR -- color for the screen fade effect when gaining a level
  • LEVELDN_SOUND -- sound when a player loses a level
  • LEVELDN_SCREEN_FADE_ENABLED -- whether the screen fade effect when a player loses a level will be active
  • LEVELDN_SCREEN_FADE_COLOR -- color for the screen fade effect when losing a level
  • FINAL_LEVEL_FLAGS -- here you can specify admin flags that players will receive when they reach the final level
  • VIP_FLAGS -- players with these flags are considered VIP and can be set to receive more XP than regular players
  • USE_COMBINED_EVENTS -- whether the plugin will use combined XP rewards for specific events
  • TEAM_LOCK -- if non-zero, only players that are in thee team set here will be able to receive XP
  • MINIMUM_PLAYERS -- if greater than 0, players won't be able to receive XP if there are less than X players in the server
  • NOTIFY_ON_KILL -- if enabled, player will receive chat notifications about the XP they receive when killing a player, as well as when committing suicide if the plugin is set to take XP on suicide
  • HUDINFO_ENABLED -- whether the HUD info that shows your XP will be enabled
  • HUDINFO_VISIBILITY -- who and when is able to see the HUD info
  • HUDINFO_TEAM_LOCK -- if the TEAM_LOCK option is enabled and this one is set to 1, players won't be able to see the HUD info if they're not on the team set in TEAM_LOCK, the same applies for the player they're spectating
  • HUDINFO_OTHER_PLAYERS -- whether players will be able to see the HUD info of the player they're spectating while dead
  • HUDINFO_COLOR -- color for the HUD info
  • HUDINFO_POSITION -- coordinates for the HUD info for alive players
  • HUDINFO_POSITION_DEAD -- coordinates for the HUD info for dead players
  • HUDINFO_USE_DHUD -- whether the HUD info will use a DHUD message
  • HUDINFO_FORMAT -- how the HUD info is going to look when the player is on any level except the last one
  • HUDINFO_FORMAT_FINAL -- how the HUD info is going to look when the player is on the last level
  • HUDINFO_INVALID_TEXT -- what is the HUD info going to display when an invalid value is given
  • XP_NOTIFIER_ENABLED -- whether the plugin will show a separate HUD message when gaining/losing XP
  • XP_NOTIFIER_COLOR_GET -- color for the XP notifier when gaining XP
  • XP_NOTIFIER_COLOR_LOSE -- color for the XP notifier when losing XP
  • XP_NOTIFIER_POSITION -- coordinates for the XP notifier
  • XP_NOTIFIER_DURATION -- duration of the XP notifier
  • XP_NOTIFIER_USE_DHUD -- whether the XP notifier will use a DHUD message

Configuring the ranks
  • The ranks can be easily configured in the [Ranks] section in the .ini file.
  • As you can see from the default ranks set in the file, each rank is added on a new line by writing its name and the required XP for it separated with the "=" symbol.
  • The first rank must start from 0 XP.
  • The number of ranks you can add is unlimited.
  • The name of the ranks can't start with any of these symbols: "#", ";", "-" and "["

Configuring the XP rewards
  • Unlike other plugins where there is a separate setting for each way of earning XP, this plugin has things set up quite differently and it's much easier to use.
  • In the [XP Rewards] section you can configure all kinds of XP rewards depending on special keywords.
  • For example, if you want players to receive 5 XP on a normal kill, you simply need to write "kill = 5" on a new line in the section, since the keyword "kill" tells the plugin that this reward should be given when you kill a player. For a kill with a headshot, simply use the keyword "headshot", and so on.
  • You can even add a separate reward for each weapon in a game, e.g. "awp = 10".
  • In order to make VIP users receive different amount of XP than the regular players, for example 10 XP for planting the bomb, while regular players receive 7 XP, you should write "bomb_planted = 7 10".
  • Take a look at this link for all keywords available in the plugin.

Showing the ranks in chat
  • Since this plugin mainly refers to XP, levels and ranks, and not the chat itself, it is necessary to download a separate plugin for the chat in order to show the ranks in it. Use the Chat Manager plugin for that purpose.
  • I have added support in Chat Manager for this plugin, so you can easily activate the ranks in it.
  • In order to activate them, you need to add the keyword $rank$ in the [Format Definition] section in the plugin's configuration file. You can make the ranks show only for regular players, along with the admin prefix, etc.
  • If you don't know how and where to add it, follow these steps:
    • Open the configuration file - configs/ChatManager.ini.
    • Find the [Format Definitions] section and replace the 4 settings inside it with these ones:

      PHP Code:

      format_admin $dead_prefix$ &x04[$rank$] $admin_prefix$ &x03$custom_name$ &x01$chat_color$$message$
      format_admin_team $dead_prefix$ ($team$) &x04[$rank$] $admin_prefix$ &x03$custom_name$ &x01$chat_color$$message$
      format_player $dead_prefix$ &x04[$rank$] &x03$custom_name$ &x01$chat_color$$message$
      format_player_team $dead_prefix$ ($team$) &x04[$rank$] &x03$custom_name$ &x01$chat_color$$message

    • If you don't want the rank to be displayed for the admins who already have an admin prefix, replace only the last two settings and leave the first ones unchanged.

Credits
  • Huehue for help with making the SQL part of the plugin.

Additional information and download link

https://raw.githubusercontent.com/Oc...using_this.png
https://raw.githubusercontent.com/Oc...plugin_lab.png
https://raw.githubusercontent.com/Oc...ad_default.png

Rivotril 06-24-2018 14:47

Re: OciXCrom's Rank System
 
Looks pretty good

tarsisd2 06-24-2018 14:59

Re: OciXCrom's Rank System
 
looks great!

that picture of rank system XP list, shouldn't it be in order, biggest xp in first and so on?

WhiteFang1319 06-24-2018 15:07

Re: OciXCrom's Rank System
 
A ranking system with many configurable options and that too by OciXCrom, looks great

OciXCrom 06-24-2018 15:08

Re: OciXCrom's Rank System
 
Thanks for the nice comments.

Quote:

Originally Posted by tarsisd2 (Post 2599118)
looks great!

that picture of rank system XP list, shouldn't it be in order, biggest xp in first and so on?

I was thinking the same after I saw it. :)
I'll probably edit it later (after I actually find out how to use the sorting functions after all this time).

tarsisd2 06-24-2018 15:22

Re: OciXCrom's Rank System
 
Brazillian Portuguese [bp]

RankSystem.txt
PHP Code:

[bp]
CRXRANKS_RANKINFO_NORMAL Voce tem &x04%i/%i XP&x01Seu rank &x04#%i&x01: &x03%s&x01. Proximo rank: &x03%s&x01.
CRXRANKS_RANKINFO_FINAL Voce tem &x04%i XP&x01Seu rank &x04#%i&x01: &x03%s&x01. Voce esta no ultimo level!
CRXRANKS_GIVE_XP = &x03%&x01perdeu &x04%i XP &x01para &x03%s
CRXRANKS_TAKE_XP 
= &x03%&x01tomou &x04%i XP &x01de &x03%s
CRXRANKS_RESET_XP 
= &x03%&x01resetou &x03%s&x01's XP
CRXRANKS_LEVEL_REACHED = &x03%s &x01subiu para o&x04Level %i &x01[&x03%s&x01]
CRXRANKS_LEVEL_LOST = &x03%s &x01voltou para o &x04Level %i &x01[&x03%s&x01]
CRXRANKS_MENU_TITLE = \rOciXCrom'
\ySistema de Rank: \rLista de XP
CRXRANKS_ITEM_FORMAT 
= \d[%i XP] \w%\r[\yLevel %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE 
= -%i XP 

RankSystemNoColors.txt
PHP Code:

[bp]
CRXRANKS_RANKINFO_NORMAL Voce tem %i/%i XPSeu rank #%i: %s. proximo rank: %s.
CRXRANKS_RANKINFO_FINAL Voce tem %i XPSeu rank #%i: %s. Voce esta no ultimo level!
CRXRANKS_GIVE_XP = %s perdeu %i XP para %s
CRXRANKS_TAKE_XP 
= %s tomou %i XP de %s
CRXRANKS_RESET_XP 
= %s resetou %s's XP
CRXRANKS_LEVEL_REACHED = %s subiu para o Level%i [%s]
CRXRANKS_LEVEL_LOST = %s voltou para o level Level %i [%s]
CRXRANKS_MENU_TITLE = \rOciXCrom'
\ySistema de Rank: \rLista de XP
CRXRANKS_ITEM_FORMAT 
= \d[%i XP] \w%\r[\yLevel %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE 
= -%i XP 


DevilBoy.eXe 06-24-2018 17:04

Re: OciXCrom's Rank System
 
As always, OciXCrom makes the best plugins :D
Code:

[ro] -- DevilBoy.eXe
CRXRANKS_RANKINFO_NORMAL = Ai &x04%i/%i XP&x01. Rangul tau este &x04#%i&x01: &x03%s&x01. Urmatorul rang: &x03%s&x01.
CRXRANKS_RANKINFO_FINAL = Ai &x04%i XP&x01. Rangul tau este &x04#%i&x01: &x03%s&x01. Ai ajung la ultimul nivel!
CRXRANKS_GIVE_XP = &x03%s &x01a dat &x04%i XP &x01lui &x03%s
CRXRANKS_TAKE_XP = &x03%s &x01a luat &x04%i XP &x01de la &x03%s
CRXRANKS_RESET_XP = &x03%s &x01ia resetat XP-u lui &x03%s&x01
CRXRANKS_LEVEL_REACHED = &x03%s &x01a ajuns la &x04Nivelul %i &x01[&x03%s&x01]
CRXRANKS_LEVEL_LOST = &x03%s &x01a ajuns inapoi la &x04Nivelul %i &x01[&x03%s&x01]
CRXRANKS_MENU_TITLE = \rOciXCrom's \yRang System: \rLista XP
CRXRANKS_ITEM_FORMAT = \d[%i XP] \w%s \r[\yNivel %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE = -%i XP


SHIELD755 06-24-2018 21:03

Re: OciXCrom's Rank System
 
Awesome I have tested :)

OciXCrom 06-25-2018 08:11

Re: OciXCrom's Rank System
 
The translations have been added. Thanks.

Fuck For Fun 06-25-2018 12:09

Re: OciXCrom's Rank System
 
GJ, I Like it =]

EDIT:
I think it is unnecessary to add a Tag Rank
3: 0 EXP - Test Player?
- Recommended for server - surf? public?

OciXCrom 06-25-2018 12:33

Re: OciXCrom's Rank System
 
Quote:

Originally Posted by Fuck For Fun (Post 2599213)
I think it is unnecessary to add a Tag Rank
3: 0 EXP - Test Player?

What do you mean? I don't understand.

Quote:

Originally Posted by Fuck For Fun (Post 2599213)
Recommended for server - surf? public?

It can be used in any server, any mod, any game.

OciXCrom 06-25-2018 15:21

Re: OciXCrom's Rank System
 
https://img.shields.io/badge/update-...2018-green.svg
  • The update includes changes only to the file crx_ranksystem.sma.
  • Made the players in the /xplist menu to be sorted according to their XP, starting from the player with the most XP on top of the list.

Lyklor 06-25-2018 16:00

Re: OciXCrom's Rank System
 
Turkish [tr]

RankSystem.txt
Code:

[tr] -- Czarintax
CRXRANKS_RANKINFO_NORMAL = Tecruben &x04%i/%i XP&x01. Siralaman &x04#%i&x01: &x03%s&x01. Sonraki rutbe: &x03%s&x01.
CRXRANKS_RANKINFO_FINAL = Tecruben &x04%i XP&x01. Siralaman &x04#%i&x01: &x03%s&x01. Son seviyedesin!
CRXRANKS_GIVE_XP = &x03%s&x01, &x03%s &x01oyuncusuna &x04%i XP &x01verdi.
CRXRANKS_TAKE_XP = &x03%s&x01, &x03%s &x01oyuncusundan &x04%i XP &x01aldi.
CRXRANKS_RESET_XP = &x03%s, &x03%s &x01oyuncusunun tecrubesini sifirladi.
CRXRANKS_LEVEL_REACHED = &x03%s &x04%i. &x01seviyeye ulasti. [&x03%s&x01]
CRXRANKS_LEVEL_LOST = &x03%s &x04%i. &x01seviyeye dustu. [&x03%s&x01]
CRXRANKS_MENU_TITLE = \rOciXCrom'un \yRutbe Sistemi: \rXP Listesi
CRXRANKS_ITEM_FORMAT = \d[%i XP] \w%s \r[\ySeviye %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE = -%i XP

RankSystemNoColors.txt
Code:

[tr] -- Czarintax
CRXRANKS_RANKINFO_NORMAL = Tecruben %i/%i XP. Siralaman #%i: %s. Sonraki rutbe: %s.
CRXRANKS_RANKINFO_FINAL = Tecruben %i XP. Siralaman #%i: %s. Son seviyedesin!
CRXRANKS_GIVE_XP = %s, %s oyuncusuna %i XP verdi.
CRXRANKS_TAKE_XP = %s, %s oyuncusundan %i XP aldi.
CRXRANKS_RESET_XP = %s, %s oyuncusunun tecrubesini sifirladi.
CRXRANKS_LEVEL_REACHED = %s %i. seviyeye ulasti. [%s]
CRXRANKS_LEVEL_LOST = %s %i. seviyeye dustu. [%s]
CRXRANKS_MENU_TITLE = \rOciXCrom'un \yRutbe Sistemi: \rXP Listesi
CRXRANKS_ITEM_FORMAT = \d[%i XP] \w%s \r[\ySeviye %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE = -%i XP


xeloxded 06-25-2018 23:42

Re: OciXCrom's Rank System
 
I cant won exp for some reason... kills give 0, bomb 0, every sort of death give 0 exp...

OciXCrom 06-26-2018 07:45

Re: OciXCrom's Rank System
 
@Lyklor - added, thanks.

@xeloxded - that's strange. Maybe you deleted the last lines in the .ini file by accident, since that is where the rewards are set? Any error logs? What AMXX version are you using?

xeloxded 06-26-2018 14:12

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
1.8.3

I didnt edited anything, gonna test it again, will update soon
edit: Got it working, its fine now.

I got a suggestion, I think you should add more customization in your plugin, like, instead of showing XP earned/loss via dhud/hud you could also show their earned exp via print_chat

You earned 3 experience by killing an enemy by headshot
You earned 3 experience by killing an enemy with an M4A1
You earned 3 experience by killing an enemy
You earned 5 experience for defusing the bomb

another suggestion is that you shouldnt display your HUD showing your Experience or rank if I am not on a team already, if you want your plugin to work with another type of system like a Register system you can see other people information without being logged, and I think its not logical showing a HUD when you are not on a team.



It makes your plugin more complete than what it is already.

Relaxing 06-29-2018 05:13

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Bonjour,
Have you made sure that switching to all 3 save type platforms, it won't create sort of old backup that what was saved on last platform?

OciXCrom 06-29-2018 08:34

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Quote:

Originally Posted by xeloxded (Post 2599406)
1.8.3

I didnt edited anything, gonna test it again, will update soon
edit: Got it working, its fine now.

I got a suggestion, I think you should add more customization in your plugin, like, instead of showing XP earned/loss via dhud/hud you could also show their earned exp via print_chat

You earned 3 experience by killing an enemy by headshot
You earned 3 experience by killing an enemy with an M4A1
You earned 3 experience by killing an enemy
You earned 5 experience for defusing the bomb

another suggestion is that you shouldnt display your HUD showing your Experience or rank if I am not on a team already, if you want your plugin to work with another type of system like a Register system you can see other people information without being logged, and I think its not logical showing a HUD when you are not on a team.



It makes your plugin more complete than what it is already.

Sorry, I didn't see the comment since you edited it later.

I was thinking about showing that information in chat, but when you think about it, you will have to have a separate translation for every single one of those, which I find very inconvenient, especially since the plugin has an option for users to create their custom XP rewards for various events. Maybe something like You earned 3 experience for the event "kill" would be more acceptable from coding perspective, but it would still be messy when a player receives multiple rewards at the same time (e.g. kill + headshot + knife).

About the other suggestion - I'll see what I can do. The plugin is designed to work for all games, not only CS, so I'll have to find a better way to check if a player is not in a team. For now you can activate the option that makes the HUD invisible for dead players.

Quote:

Originally Posted by Relaxing (Post 2599818)
Bonjour,
Have you made sure that switching to all 3 save type platforms, it won't create sort of old backup that what was saved on last platform?

I doubt that anyone will ever change that option after the first setup, so I didn't find it necessary to add something to prevent this. Even if they do, the chances that someone will use a name as their IP or SteamID are minimal. Still, you can easily change the name of the file where the data is stored IF you ever have the need to switch it.

Godofwar 06-29-2018 16:23

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Code:

[de]
CRXRANKS_RANKINFO_NORMAL = Du hast &x04%i/%i XP&x01. Dein Rank ist &x04#%i&x01: &x03%s&x01. Naechster Rank: &x03%s&x01.
CRXRANKS_RANKINFO_FINAL = Du hast &x04%i XP&x01. Dein Rank ist &x04#%i&x01: &x03%s&x01. Du bist auf dem letzten Level!
CRXRANKS_GIVE_XP = &x03%s &x01gab &x04%i XP &x01an &x03%s
CRXRANKS_TAKE_XP = &x03%s &x01nahm &x04%i XP &x01von &x03%s
CRXRANKS_RESET_XP = &x03%s &x01hat die XP von &x03%s&x01 zurueckgesetzt
CRXRANKS_LEVEL_REACHED = &x03%s &x01erreichte &x04Level %i &x01[&x03%s&x01]
CRXRANKS_LEVEL_LOST = &x03%s &x01ist zurueckgegangen auf &x04Level %i &x01[&x03%s&x01]
CRXRANKS_MENU_TITLE = \rOciXCrom's \yRank System: \rXP Liste
CRXRANKS_ITEM_FORMAT = \d[%i XP] \w%s \r[\yLevel %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE = -%i XP


OciXCrom 06-30-2018 08:52

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Quote:

Originally Posted by Godofwar (Post 2599941)
Code:

[de]
CRXRANKS_RANKINFO_NORMAL = Du hast &x04%i/%i XP&x01. Dein Rank ist &x04#%i&x01: &x03%s&x01. Naechster Rank: &x03%s&x01.
CRXRANKS_RANKINFO_FINAL = Du hast &x04%i XP&x01. Dein Rank ist &x04#%i&x01: &x03%s&x01. Du bist auf dem letzten Level!
CRXRANKS_GIVE_XP = &x03%s &x01gab &x04%i XP &x01an &x03%s
CRXRANKS_TAKE_XP = &x03%s &x01nahm &x04%i XP &x01von &x03%s
CRXRANKS_RESET_XP = &x03%s &x01hat die XP von &x03%s&x01 zurueckgesetzt
CRXRANKS_LEVEL_REACHED = &x03%s &x01erreichte &x04Level %i &x01[&x03%s&x01]
CRXRANKS_LEVEL_LOST = &x03%s &x01ist zurueckgegangen auf &x04Level %i &x01[&x03%s&x01]
CRXRANKS_MENU_TITLE = \rOciXCrom's \yRank System: \rXP Liste
CRXRANKS_ITEM_FORMAT = \d[%i XP] \w%s \r[\yLevel %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE = -%i XP


Danke.

xeloxded 07-03-2018 13:37

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
For some reason sometimes it wont save my exp correctly, it will reset to 0, yesterday i gave myself 1000 exp but then (next day) it was on 0 again
SAVE_TYPE = 0
Using same nick

EDIT: On change map it will save but if I turn off server it will reset

OciXCrom 07-03-2018 19:04

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
How are you turning off your server exactly? If you're not doing it properly, the plugin won't be able to save the data.

xeloxded 07-03-2018 19:26

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Well, just closing it, but what do you mean "correctly" I mean, what if ""for some reason"" server gets shutdown (power went off, DDOS), it will loss data, not sure but I dont think thats right.
or when do you need to restart your server for whatever reason (Installing a new module or maintenance, for example)

OciXCrom 07-04-2018 08:10

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
"Just closing it" by pressing the X button is not considered a proper shutdown. This won't call any of the plugin's functions which need to detect when the map ends and the players disconnect to save the data. Not only this plugin, but none of your plugins that save stuff in the end will save them. Use the "exit" command to shut it down and "restart" to restart it.

xeloxded 07-04-2018 08:16

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Thats what I did, but still, for some reason EXP will go to 0 regardless.
I was testing with SteamID but it will save correctly

Also it makes no sense, because i am playing x map, got 10 exp and then change map it will save then close or rr server and it will go to 0 again

OciXCrom 07-04-2018 08:46

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Not sure why that is happening. I added some logs in the code that will print what's going in the logs/crxranks.log file. Leave it running for a while and upload the log file when you experience this again.

I'll upload the code in pastebin, since alliedmods has a weird bug at the moment - https://pastebin.com/9r9jEeTG

xeloxded 07-04-2018 12:33

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Quote:

L 07/04/2018 - 12:24:29: Log file started (file "cstrike/addons/amxmodx/logs/crxranks.log") (game "cstrike") (amx "1.8.3-dev+5154")
L 07/04/2018 - 12:24:29: Plugin precache started.
L 07/04/2018 - 12:24:30: Plugin init started.
L 07/04/2018 - 12:24:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:24:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:24:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: Deathrun [BOT] disconnected.
L 07/04/2018 - 12:24:56: Saving data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:24:56: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:56: The plugin has ended.
L 07/04/2018 - 12:25:30: Plugin precache started.
L 07/04/2018 - 12:25:30: Plugin init started.
L 07/04/2018 - 12:25:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:25:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:25:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:25:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:26:55: Plugin precache started.
L 07/04/2018 - 12:26:55: Plugin init started.
L 07/04/2018 - 12:26:56: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:26:58: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:00: Deathrun [BOT] connected.
L 07/04/2018 - 12:27:02: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:27:43: Plugin precache started.
L 07/04/2018 - 12:27:43: Plugin init started.
L 07/04/2018 - 12:27:44: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:27:45: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:46: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:48: Loading data for TEST [STEAM_0:0:173190571]
Maybe it has something to do with the fact that Deathrun comes with a BOT?
I just did the following, choose a map, give 100 exp, change to the same map while being connected, 100 exp still, then restart sv, 0 EXP.

OciXCrom 07-04-2018 13:04

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Let's add some colors to those logs so we can easily find what we need.

Quote:

L 07/04/2018 - 12:24:29: Log file started (file "cstrike/addons/amxmodx/logs/crxranks.log") (game "cstrike") (amx "1.8.3-dev+5154")
L 07/04/2018 - 12:24:29: Plugin precache started.
L 07/04/2018 - 12:24:30: Plugin init started.
L 07/04/2018 - 12:24:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:24:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:24:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: Deathrun [BOT] disconnected.
L 07/04/2018 - 12:24:56: Saving data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:24:56: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:24:56: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:24:56: The plugin has ended.
L 07/04/2018 - 12:25:30: Plugin precache started.
L 07/04/2018 - 12:25:30: Plugin init started.
L 07/04/2018 - 12:25:31: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:25:33: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:25:35: Deathrun [BOT] connected.
L 07/04/2018 - 12:25:37: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:26:55: Plugin precache started.
L 07/04/2018 - 12:26:55: Plugin init started.
L 07/04/2018 - 12:26:56: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:26:58: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:00: Deathrun [BOT] connected.
L 07/04/2018 - 12:27:02: Loading data for Deathrun Sunshine [BOT]
L 07/04/2018 - 12:27:43: Plugin precache started.
L 07/04/2018 - 12:27:43: Plugin init started.
L 07/04/2018 - 12:27:44: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] disconnected.
L 07/04/2018 - 12:27:45: Saving data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:45: TEST [STEAM_0:0:173190571] connected.
L 07/04/2018 - 12:27:46: Loading data for TEST [STEAM_0:0:173190571]
L 07/04/2018 - 12:27:48: Loading data for TEST [STEAM_0:0:173190571]
You can clearly see that your server isn't behaving properly. The functions that are called when the server starts (the plugin precache and plugin init messages) are printed 4 times in the file, but the function that is supposed to be called when the plugin ends (the plugin has ended message) is called only once. This means that out of 4 map changes, only 1 was successful and the data was saved there. During the other 3 changes, no data was saved because the server didn't change the map properly. As you can see the data wasn't saved in these cases either. You probably have some plugin that is crashing the server when the map ends or causing some other kind of problem. This is not something that I can fix because the problem is not in this plugin.

xeloxded 07-04-2018 13:15

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
I have nothing else more than Deathrun Manager, your custom chat, Ranks and Knife there (and Joropito multimod) so yeah, not sure what is going on

Its strange too because even if the data wasnt saved later, first map I testeed was where I gave me EXP and then it saved correctly

OciXCrom 07-04-2018 15:30

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
The Deathrun Manager itself can be causing the problem - if I recall correctly, its code isn't very good. I suggest you disable any other plugins and enable them 1 by 1 to see which one is causing the problem. You can use the error logs generated from my plugin to help you in the process.

xeloxded 07-04-2018 21:07

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Still cant found a fix :/

OciXCrom 07-05-2018 08:04

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
I can't do anything about that. The problem is from your server, not the plugin.

xeloxded 07-05-2018 13:15

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Yeah, but I think I know what is causing problems, will try to fix it, going to edit soon

Napoleon_be 07-05-2018 15:31

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Dutch translation

Well done btw.

Code:

[nl] -- NapoleoN#
CRXRANKS_RANKINFO_NORMAL = Je hebt &x04%i/%i XP&x01. Uw rang is &x04#%i&x01: &x03%s&x01. Volgend rang: &x03%s&x01.
CRXRANKS_RANKINFO_FINAL = Je hebt &x04%i XP&x01. Uw rang is &x04#%i&x01: &x03%s&x01. Je bent aan het laatste level!
CRXRANKS_GIVE_XP = &x03%s &x01 gaf &x04%i XP &x01aan &x03%s
CRXRANKS_TAKE_XP = &x03%s &x01nam &x04%i XP &x01van &x03%s
CRXRANKS_RESET_XP = &x03%s &x01resette &x03%s&x01's XP
CRXRANKS_LEVEL_REACHED = &x03%s &x01heeft &x04Level %i &x01bereikt [&x03%s&x01]
CRXRANKS_LEVEL_LOST = &x03%s &x01is weer op &x04Level %i &x01[&x03%s&x01]
CRXRANKS_MENU_TITLE = \rOciXCrom's \yRang Systeem: \rXP Lijst
CRXRANKS_ITEM_FORMAT = \d[%i XP] \w%s \r[\yLevel %i: %s\r]
CRXRANKS_XP_NOTIFIER_GET = +%i XP
CRXRANKS_XP_NOTIFIER_LOSE = -%i XP


Supergirl 07-05-2018 17:41

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
A small thing about LEVELUP_MESSAGE_TYPE in ini file - shouldn't it have only option 0 (disabled) and 2 (visible for everybody). I mean, I think that option 2 should be occupying option 1's position (because it makes no sense for only the player who gains a level see the message saying that he just did it, having into account that he will see the "You did it" message [in 2nd person]). Don't know if it makes sense or if I explained myself clearly, if not, please say it and I'll try my best to do so. It seems really good, for now (did not test it, gonna test it soon).
FORGET THIS MESSAGE (I did not see that there was no message in 2nd person, so everything makes sense now).
Having second thoughts, DO NOT FORGET THIS MESSAGE: it is ok, but maybe instead of option 1 (still this option) saying that "player x has reached y level", wouldn't it be better having the message in 2nd person (since it's only for the player who reached a new level). Instead of that, it should be "You have reached y level" (if the option was set to 1). It's not a big deal, to be honest, I was just wondering...

OciXCrom 07-05-2018 18:15

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
Quote:

Originally Posted by Napoleon_be (Post 2601208)
Dutch translation

Well done btw.

Thanks. Added.

Quote:

Originally Posted by Supergirl (Post 2601230)
A small thing about LEVELUP_MESSAGE_TYPE in ini file - shouldn't it have only option 0 (disabled) and 2 (visible for everybody). I mean, I think that option 2 should be occupying option 1's position (because it makes no sense for only the player who gains a level see the message saying that he just did it, having into account that he will see the "You did it" message [in 2nd person]). Don't know if it makes sense or if I explained myself clearly, if not, please say it and I'll try my best to do so. It seems really good, for now (did not test it, gonna test it soon).
FORGET THIS MESSAGE (I did not see that there was no message in 2nd person, so everything makes sense now).
Having second thoughts, DO NOT FORGET THIS MESSAGE: it is ok, but maybe instead of option 1 (still this option) saying that "player x has reached y level", wouldn't it be better having the message in 2nd person (since it's only for the player who reached a new level). Instead of that, it should be "You have reached y level" (if the option was set to 1). It's not a big deal, to be honest, I was just wondering...

Yeah, I was thinking the same while making the message, but I figured it's really not a big deal. I doubt that many people will even set the setting to "1". Anyways, it's too late to change it now because I already have 10 different translations for the plugin and I don't feel like bothering people to translate more stuff for it, at least for now.

Supergirl 07-06-2018 10:29

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
I understand. Anyways, if you feel like doing it in the future, here it is how it should be in portuguese (translated by tarsisd2) and english (translated by you).

[bp]
CRXRANKS_LEVEL_REACHED = &x03%s &x01subiu para o&x04Level %i &x01[&x03%s&x01] current
CRXRANKS_LEVEL_REACHED = &x03Voce &x01subiu para o&x04Level %i &x01[&x03%s&x01] replace for this
(it is the same thing, just change "%s" to "Voce" which means you).

[en]
CRXRANKS_LEVEL_REACHED = &x03%s &x01has reached &x04Level %i &x01[&x03%s&x01] current
CRXRANKS_LEVEL_REACHED = &x03You &x01have reached &x04Level %i &x01[&x03%s&x01] replace for this
(it is the same thing, just change "%s" to "You" and "has" to "have").

xeloxded 07-06-2018 12:37

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
I think its a nVault problem, for some reason it wont load on console when I type "modules"

Quote:

[ 1] AMX Mod X, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 2] MySQL, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 3] SQLite, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 4] Fun, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 5] Engine, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 6] FakeMeta, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 7] GeoIP, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
[ 8] CStrike, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 9] Ham Sandwich, v1.8.3-dev+5154, Dec 7 2017, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 10] ReAPI, v5.6.0.157-dev, 2018-05-22, by Asmodai & s1lent, see https://github.com/s1lentq/reapi/
[ 11] CSX, v1.8.3-dev+5154, Mar 9 2018, by AMX Mod X Dev Team, see http://www.amxmodx.org/
nvault is active on modules.ini
AMXX 1.8.3 last version

(I tested other plugins with MySQL, Sqlite and adv_vault, all working without losing anything)

I would try to switch to MySQL

xeloxded 07-06-2018 23:25

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
I managed to try another plugin that saves things, It lose data aswell, sometimes changing map or RR server it will go to 0, I dont know whats happening ;/

OciXCrom 07-07-2018 08:20

Re: OciXCrom's Rank System [XP|Levels|Ranks]
 
That's what I'm trying to tell you, every plugin that saves data on map end will fail to work sometimes. nVault should appear in your modules - it does in my server at least. Try removing all plugins leaving only the rank system and see if the problem persists. If it does, reinstall the entire server and AMXX.

Also, If i'm correct, you won't have this problem only with nVault, but with every plugin that saves data on map end or player disconnect. The only difference is that nVault works in a way that if not handled properly it can reset the data, while some other methods will lose only the data gained on that current map. So, using another method is not a solution either, because you will still use data.


All times are GMT -4. The time now is 08:52.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.