AlliedModders

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

Supremache 09-07-2020 10:52

Rank System [ Ranks | Levels | EXP ]
 
2 Attachment(s)
Rank System 1.2
Release: September, 07,2020 | Last Update: May, 24, 2021


Table of Contents
Description top

Give players something to play for!
Images top


Installation top

To install the plugin:
  1. Download the zip file..
  2. Put RankSystem.amxx in cstrike/addons/amxmodx/plugins
  3. Open addons/amxmodx/configs/plugins.ini and add at the end of this file RankSystem.amxx
  4. Restart the server/change map.
Cvars top
  • save_type: Saving data using steam id, name, ip. Default 1
    • 2 = Name | 3 = IP | Default(0, 1, 4, 5, etc) = Steam .
  • hud_rank: Enable / Disable Hud. Default 1
  • kill_xp: EXP Bouns. Default 15
  • hs_xp: Head Shot Bouns. Default 5
  • he_xp: HE Granade Bouns. Default 5
  • knife_xp: Knife Bouns. Default 10
Access's top
Spoiler


Commands top
  • /xplist: Opens a menu that show online players for checking them rank data.
  • /resetdata: Opens a menu that show online players for reset them rank data.
  • /managa: Opens a menu that show online players for changing them rank.
  • amx_givelvl: Console commands that can let you give players more levels.
  • amx_givexp: Console commands that can let you give players more xp.
Credits top
  • CrazY.: for exmple: how to combine the menus Link.
ChangeLog top
  • Version: 1.0 (September, 05,2020 ):
    • Initial release.
  • Version: 1.1 (May, 17,2021 ):
    • Fixed a bug when player get more than max level, hud get bug.
    • Added give level cmd.
    • Added give xp cmd.
    • Added reset user data menu.
    • Added forward level up.
    • Added native get_max_levels.
  • Version: 1.2 ( May, 24, 2021 ):
    • Fixed a bug When using give xp cmd showing error log msg.
    • Fixed a bug When reset data of player the first rank get disable.
    • Fixed a bug name doesn't get update.
    • Support 1.8.3+ & Any mode.
    • Improved Load / Save checks against bots or hltv proxies.
    • Added native get_user_next_rank.
    • Less hard coded.
    • Optimizied Code.
Downloads top
  • Version 1.0: 423 Downloads.
  • Version 1.1: 10 Downloads.

ZaKaRiAMaGh 09-07-2020 11:21

Re: Rank System [ Ranks | Levels | EXP ]
 
i will try it

OciXCrom 09-07-2020 15:14

Re: Rank System [ Ranks | Levels | EXP ]
 
So basically it's the same as mine, only hardcoded and much less options. :\

Napoleon_be 10-10-2020 15:04

Re: Rank System [ Ranks | Levels | EXP ]
 
Quote:

Originally Posted by OciXCrom (Post 2717068)
So basically it's the same as mine, only hardcoded and much less options. :\


Supremache 10-10-2020 22:53

Re: Rank System [ Ranks | Levels | EXP ]
 
So, what i have to do ??

Napoleon_be 10-11-2020 04:38

Re: Rank System [ Ranks | Levels | EXP ]
 
Quote:

Originally Posted by Supremache (Post 2720902)
So, what i have to do ??

1) Don't hardcode (didn't check your code but if OciXCrom says there's some hardcoding in there, he's probably right)

2) If you release a plugin that already exists, make sure it has more features than the other plugin(s).

3) There are already a lot of plugins simular to this one, i would just suggest coming up with an idea that no one has ever had before.

Supremache 10-11-2020 06:37

Re: Rank System [ Ranks | Levels | EXP ]
 
Quote:

Originally Posted by Napoleon_be (Post 2720928)
1) Don't hardcode (didn't check your code but if OciXCrom says there's some hardcoding in there, he's probably right)

2) If you release a plugin that already exists, make sure it has more features than the other plugin(s).

3) There are already a lot of plugins simular to this one, i would just suggest coming up with an idea that no one has ever had before.

Well, It's beta version and started to learn the scripting before some months but it's okay i learning everyday new thing and i'm happy when some one support me and provide me some suggestions..

Napoleon_be 10-11-2020 06:47

Re: Rank System [ Ranks | Levels | EXP ]
 
Quote:

Originally Posted by Supremache (Post 2720942)
Well, It's beta version and started to learn the scripting before some months but it's okay i learning everyday new thing and i'm happy when some one support me and provide me some suggestions..

But i want to ask about what do you mean about hardcoded ? I think my plugin is so easy and I have put "Rank Name" beside "EXP" for being easy for who want to editing them.

For example this is hardcoding your array size:

PHP Code:

new szName[32];
get_user_name(idszName31); 

This is just a simple example, if you declare your arrays globaly and need to retrieve the array size multiple times, you should use charsmax() instead of hardcoding the array size everytime. When using charsmax(), you only have to change the array size (if u ever have to) and everything will be fine.

For example, if szName[32] ever becomes szName[64], you have to redo every single line where you used that array.

charsmax() fixes this problem.

PHP Code:

new szName[32];
get_user_name(idszNamecharsmax(szName)); 

charsmax is the same as sizeof() - 1. The function itself says it, maximum characters available for the array.

Supremache 10-11-2020 07:21

Re: Rank System [ Ranks | Levels | EXP ]
 
Quote:

Originally Posted by Napoleon_be (Post 2720944)
For example this is hardcoding your array size:

PHP Code:

new szName[32];
get_user_name(idszName31); 

This is just a simple example, if you declare your arrays globaly and need to retrieve the array size multiple times, you should use charsmax() instead of hardcoding the array size everytime. When using charsmax(), you only have to change the array size (if u ever have to) and everything will be fine.

For example, if szName[32] ever becomes szName[64], you have to redo every single line where you used that array.

charsmax() fixes this problem.

PHP Code:

new szName[32];
get_user_name(idszNamecharsmax(szName)); 

charsmax is the same as sizeof() - 1. The function itself says it, maximum characters available for the array.

Well, thanks i understand but what is better sizeof() -1 or charsmax()

OciXCrom 10-11-2020 07:24

Re: Rank System [ Ranks | Levels | EXP ]
 
charsmax = sizeof - 1

Also, those small hardcoded details are nothing compared to the entire ranks and XP being hardcoded, lacking a configuration file.


All times are GMT -4. The time now is 21:57.

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