Code Monkey home page Code Monkey logo

-zr-zombie-rank's Introduction

[ZR/ZP] Rank System

A simple rank system destined to servers with any plugins related to the Zombie Gamemode (that is supported currently).

Requirements:

MySQL

Add this to your databases.cfg in addons/sourcemod/configs and change it as you need.

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

Installation

  1. Put the file zr_rank.smx in addons/sourcemod/plugins;
  2. Put the file zr_rank.phrases.txt in addons/sourcemod/translations

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 Infected Humans;
  • sm_humanwins NUMBER - It shows the Top NUMBER players listed in the database, order by Round Wins as Human;
  • sm_zombiewins NUMBER - It shows the Top NUMBER players listed in the database, order by Round Wins as Zombie;
  • sm_resetrank_all - It will reset all the players in the database (needs ROOT FLAG to have access);
  • sm_mystats - Show every stat that you the player has in the database;
  • sm_resetmyrank - It lets a player delete his rank by himself;

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 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_allow_warmup (Default: 0) - Allow players to get or lose points during Warmup;
  • zr_rank_prefix (Default: [{green}ZR Rank{default}] - Prefix to be used in every chat's plugin (You can use ColorVariables colors code);
  • zr_rank_suicide (Default: 0) - How many points a player lose when 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 an zombie;
  • zr_rank_inactive_days (Default: 30) - It resets a player database when he is not connected from at least X days;
/*********************************************************
 * 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);

/*********************************************************
 * 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);

/*********************************************************
 * 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 client, int points);

/*********************************************************
 * Reset a Player's Stats
 *
 * @param client		The client to reset the data
 * @noreturn
 *********************************************************/
native bool ZR_Rank_ResetPlayer(int client);

Changelog

To see the full changelog, check the CHANGELOG.md file -> https://github.com/hallucinogenic/-ZR-Zombie-Rank/blob/master/CHANGELOG.md

To-Do List

  • Translations -> DONE;
  • Support for more than 10 players in the sm_top command; -> DONE
  • Lose points by being infected or killed; -> DONE
  • Better checker for left and right mouse buttons when you stab a zombie;
  • A simple API for another sub-plugins; - Partialy DONE
  • A WebPage to show the rank of any player;
  • Optimize the code (A LOT);
  • Other suggestions given to me;

I hope you enjoyed, and I'll keep this repository updated as soon as I update the plugin!

My Steam Profile if you have any questions -> http://steamcommunity.com/id/HallucinogenicTroll/

My Website -> http://HallucinogenicTrollConfigs.com/

-zr-zombie-rank's People

Contributors

agentwesker avatar blueberryy avatar luis-rei97 avatar nicobuu avatar shanapu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

-zr-zombie-rank's Issues

[Bug] Killed by zombie check won't trigger

Lines 95 to 99 in zr_rank/events.sp have a check for human being killed by zombie, but it is nested within a check that the attacker is Human and victim is Zombie, so it won't get triggered.

Compilation error

//// zr_rank.sp
//
// zr_rank.sp(24) : fatal error 183: cannot read from file: "zombieplague"
//
// Compilation aborted.
// 1 Error.
//
// Compilation Time: 0,08 sec

Although I have a plugin from sm-zombiereloaded-3-Franug-Edition

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.