AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S?/CS:GO ZR/ZP] Simple Rank System (V1.6, 08-07-2018) (https://forums.alliedmods.net/showthread.php?t=307756)

Hallucinogenic Troll 05-23-2018 18:49

[CS:S?/CS:GO ZR/ZP] Simple Rank System (V1.6, 08-07-2018)
 
[ZR/ZP] Simple Rank:

A simple rank system destined to Zombie Mod/Zombie Escape servers.
Since I didn't find a rank plugin with the specifics that I wanted, I decided to make one by myself.
It's still in beta, so it has a lot to go through (and it's my first plugin with databases).

Requirements:
Installation:
  1. Drag the file named zr_rank.smx to addons/sourcemod/plugins;
  2. Add the database in databases.cfg located in addons/sourcemod/configs, like this:
    Code:

    "zr_rank"
    {
      "driver"    "mysql"
      "host"      "YOUR_HOST_ADDRESS"
      "database"  "YOUR_DATABASE_NAME"
      "user"      "DATABASE_USERNAME"
      "pass"      "USERNAME_PASSWORD"
    }

  3. Restart the server;
  4. Edit the cvars as you like in, zr_rank.cfg, located in cfg/zr_rank;

ConVars:
  • zr_rank_startpoints (Default: 100) - Number of points that a new player starts;
  • zr_rank_infecthuman (Default: 1) - Number of points that you get when you infect an human (0 will disable it)
  • zr_rank_killzombie (Default: 1) - Number of points that you get when you kill a zombie (0 will disable it)
  • zr_rank_killzombie_headshot (Default: 2) - Number of points that you get when you kill a zombie with an headshot (0 will disable it);
  • zr_rank_killzombie_knife (Default: 5) - Number of points that you get when you kill a zombie with a knife (0 will disable it);
  • zr_rank_killzombie_he (Default: 3) - Number of points that you get when you kill a zombie with a He Grenade (0 will disable it);
  • zr_rank_killzombie_smokeflashbang (Default: 20) - Number of points that you get when you kill a zombie with a Smoke/Flashbang (0 will disable it);
  • zr_rank_stabzombie_left (Default: 1) - Number of points that you get when you stab a zombie with left mouse button (0 will disable it);
  • zr_rank_stabzombie_right (Default: 1) - Number of points that you get when you stab a zombie with right mouse button (0 will disable it);
  • zr_rank_maxplayers_top (Default: 50) - Max Max number of players that are shown in the top commands;
  • zr_rank_minplayers (Default: 4) - Minimum players for activating the rank system (0 will disable this function)
  • zr_rank_beinginfected (Default: 1) - How many points you lost if you got infected by a zombie
  • zr_rank_beingkilled (Default: 1) - How many points you lost if you get killed by an human
  • zr_rank_prefix (Default: [{purple}ZR Rank{default}]) - Changes every chat's plugin;
  • zr_rank_allow_warmup (Default: 0) - Allow players to get or lose points during warmup;
  • zr_rank_suicide (Default: 0) - How many points a player loses if he suicides;
  • zr_rank_roundwin_human (Default: 1) - How many points a player gets when he wins the round as an human;
  • zr_rank_roundwin_zombie (Default: 1) - How many points a player gets when he wins the round as a zombie;
Commands:
  • sm_rank - It shows your positions in the rank and your total points;
  • sm_top NUMBER - It shows the Top NUMBER players listed in the database, order by Points;
  • sm_topkills NUMBER - It shows the Top NUMBER players listed in the database, order by Zombies Killed;
  • sm_topinfects NUMBER - It shows the Top NUMBER players listed in the database, order by Humans Infected;
  • sm_humanwins NUMBER - It shows the Top NUMBER players listed in the database, order by Round Wins as an Human;
  • sm_zombiewins NUMBER - It shows the Top NUMBER players listed in the database, order by Round Wins as a Zombie;
  • sm_resetrank_all - It will reset all the players in the database (needs ROOT FLAG to have access);

API:
PHP Code:

/*********************************************************
 * Get's the number of a player's points
 *
 * @param client        The client to get the points
 * @return                The number of points        
 *********************************************************/
native int ZR_Rank_GetPoints(int client);

/*********************************************************
 * Sets points to a certain player
 *
 * @param client        The client to get the points
 * @param points        Number of points to set
 * @return                The number of points    
 *********************************************************/
native bool ZR_Rank_SetPoints(int clientint points);

/*********************************************************
 * Get's the number of a player's Zombie Kills
 *
 * @param client        The client to get the zombie kills
 * @return                The number of points        
 *********************************************************/
native int ZR_Rank_GetZombieKills(int client);

/*********************************************************
 * Get's the number of a player's Human Infects
 *
 * @param client        The client to get the zombie kills
 * @return                The number of points        
 *********************************************************/
native int ZR_Rank_GetHumanInfects(int client);

/*********************************************************
 * Get's the number of a player's Round Wins as Zombie
 *
 * @param client        The client to get the round wins
 * @return                The number of round wins        
 *********************************************************/
native int ZR_Rank_GetRoundWins_Zombie(int client);

/*********************************************************
 * Get's the number of a player's Round Wins as Human
 *
 * @param client        The client to get the round wins
 * @return                The number of round wins        
 *********************************************************/
native int ZR_Rank_GetRoundWins_Human(int client); 

WebPanels:Links:
To-Do List:
  • Translations - DONE;
  • Support for more than 10 players in the sm_top command - DONE;
  • Better checker for left and right mouse buttons when you stab a zombie;
  • Giving points when humans finish a map (and register the map's levels/stages);
  • A simple API for another sub-plugins Partially DONE;
  • A WebPage to show the rank of any player;
  • Optimize the code (A LOT);
  • Other suggestions given to me;

Changelog:
  • 1.0 - Plugin Release
  • View 1.1 Changelog
  • View 1.2 Changelog
  • View 1.3 Changelog
  • View 1.4 Changelog
  • View 1.5 Changelog
  • View 1.6 Changelog

ThisIsAUsername 05-25-2018 08:46

Re: [CS:GO ZR] Simple Rank System (V1.0, 23-05-2018)
 
:bacon!: Will be looking forward for new things

Hallucinogenic Troll 05-25-2018 09:27

Re: [CS:GO ZR] Simple Rank System (V1.0, 23-05-2018)
 
Version 1.1 Released!

YOU HAVE TO RESET YOUR DATABASE TO WORK WITH THIS VERSION!
  • Added one CVAR: zr_rank_maxplayers_top (Default: 50) - Max number of players that are shown in the top commands
  • Changed sm_top command. Now you can set the limit (maximum value is set by the "zr_rank_maxplayers_top" command) of top players in this command.
    --> Now you can use like this: sm_top NUMBER (if you don't add a number, it will set 10 by default).
  • Added sm_topzkills NUMBER command! It shows the top players list order by Zombie Kills;
  • Added sm_topihuman NUMBER command! It shows the top players list order by Infected Humans;
  • Cleaned a lot of useless code;

Lannister 05-25-2018 12:24

Re: [CS:GO ZR] Simple Rank System (V1.0, 23-05-2018)
 
As i told you in Steam, great plugin and great idea, it's funny because Zombie mod is a "fun mod" (you can say that) but with this you turn it into a "competitive mode", and don't get me wrong, it's great since people always gets motivated when there's some kind of competition.

Good job and keep up the good work!

Agent Wesker 05-25-2018 16:16

Re: [CS:GO ZR] Simple Rank System (V1.1, 25-05-2018)
 
Wow great plugin!

Could you add the ability to lose points from suicide / infection / being on the losing team? Also to receive X amount of points for winning the round (after certain amount of time in case of early round end) as Human team?

Hallucinogenic Troll 05-27-2018 14:53

Re: [CS:GO ZR] Simple Rank System (V1.1, 25-05-2018)
 
Version 1.2 Released!

The CFG Files are now in cfg/zr_rank instead of cfg/sourcemod
  • Added an API so that developers can make another plugins related to this plugin! Natives added:
    • ZR_Rank_GetPoints(int client); - It will return the number of points that a player has;
    • ZR_Rank_SetPoints(int client, int points); - It will set the number of points that you want, on a player;
  • Added a CVAR zr_rank_minplayers to set the minimum players that it's needed to get or lose points when you are infected/killed;
  • Added a CVAR zr_rank_beinginfected to set the number of points that you lose when you get infected by a zombie;
  • Added a CVAR zr_rank_beingkilled to set the number of points that you lose when you are killed by a human;
  • Added a Sub-plugin [ZR Rank] Connect Message which shows a message when a player connects. It has the following CVARs:
    • zr_rank_connectmessage_type (Default: 1) - Type of HUD that you want to use in the connect message (0 = Disable, 1 = HintText, 2 = CenterText, 3 = Chat, 4 = HudText);
    • zr_rank_connectmessage_hudtext_red (Default: 255) - RGB Code for the Red Color used in the HudText ("zr_rank_connectmessage_type" needs to be set on 4);
    • zr_rank_connectmessage_hudtext_green (Default: 255) - RGB Code for the Green Color used in the HudText ("zr_rank_connectmessage_type" needs to be set on 4);
    • zr_rank_connectmessage_hudtext_blue (Default: 255) - RGB Code for the Blue Color used in the HudText ("zr_rank_connectmessage_type" needs to be set on 4);

Hallucinogenic Troll 05-28-2018 15:49

Re: [CS:S?/CS:GO ZR] Simple Rank System (V1.3, 28-05-2018)
 
Version 1.3 Released!
  • Fixed a bug when a zombie is killed by a human and doesn't lose points;
  • Fixed a bug with the Zombie Kills and Human Infects. Now it checks perfectly;
  • Added two more natives:
    • ZR_Rank_GetZombieKills(int client); -> Returns the number of a client's Zombie Kills;
    • ZR_Rank_GetHumanInfects(int client); -> Returns the number of a client's Human Infections;

Also, I'm not sure if it works for CS:S, so if someone wants to check it out, thats nice.

altair540 05-30-2018 11:00

Re: [CS:S?/CS:GO ZR] Simple Rank System (V1.3, 28-05-2018)
 
SM 1.9
Quote:

L 05/30/2018 - 10:54:29: [SM] Exception reported: Array index out-of-bounds (index -1, limit 66)
L 05/30/2018 - 10:54:29: [SM] Blaming: zr_rank.smx
L 05/30/2018 - 10:54:29: [SM] Call stack trace:
L 05/30/2018 - 10:54:29: [SM] [1] Line 122, zr_rank/events.sp::ZR_OnClientInfected
L 05/30/2018 - 10:54:29: [SM] [3] Call_Finish
L 05/30/2018 - 10:54:29: [SM] [4] Line 180, zr/api/infect.api.inc::APIOnClientInfected
L 05/30/2018 - 10:54:29: [SM] [5] Line 844, zr/infect.inc::InfectHumanToZombie
L 05/30/2018 - 10:54:29: [SM] [6] Line 192, zr/respawn.inc::RespawnSpawnClient
L 05/30/2018 - 10:54:29: [SM] [7] Line 247, zr/respawn.inc::RespawnTimer

Hallucinogenic Troll 06-12-2018 10:26

Re: [CS:S?/CS:GO ZR] Simple Rank System (V1.4, 12-06-2018)
 
Version 1.4 released!
  • Merged Agent Wesker's Pull Request with the master repository;
  • Fixed some minor bugs;
  • Added translations (English and Portuguese);
  • Added a new CVAR: zr_rank_prefix (Default: [{purple}ZR Rank{default}]) -> Changes every chat's plugin;
  • Added a new CVAR: zr_rank_allow_warmup (Default: 0) -> Allow players to get or lose points during warmup;

Hallucinogenic Troll 06-21-2018 14:41

Re: [CS:S?/CS:GO ZR/ZP] Simple Rank System (V1.5, 21-06-2018)
 
Version 1.5 Released

WARNING: YOU HAVE TO RESET YOUR DATABASE TO WORK WITH THIS VERSION!
  • Fixed some bugs related to the warmup checker;
  • Added a new CVAR: zr_rank_suicide (Default: 0) - How many points a player lose when he suicides.
  • Added a new CVAR: zr_rank_roundwin_human (Default: 1) - How many points a player gets when wins the round as an human;
  • Added a new CVAR: zr_rank_roundwin_zombie (Default: 1) - How many points a player gets when wins the round as a zombie;
  • Added a new Command: sm_humanwins - Show the Top Players List, order by Round Wins as Human;
  • Added a new Command: sm_zombiewins - Show the Top Players List, order by Round Wins as Zombie;
  • Added a new native: ZR_Rank_GetRoundWins_Human - It returns a number of Round Wins as Human of a player
  • Added a new native: ZR_Rank_GetRoundWins_Zombie - It returns a number of Round Wins as Zombie of a player
  • Renamed the command sm_topzkills to sm_topkills;
  • Renamed the command sm_topihumans to sm_topinfects;
  • Added support for Zombie Plague (Not sure if it works 100%, only in theory);


All times are GMT -4. The time now is 07:25.

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