Raised This Month: $32 Target: $400
 8% 

[TF2] Easy Rank SQL


Post New Thread Reply   
 
Thread Tools Display Modes
Author
renancavalieri
AlliedModders Donor
Join Date: Feb 2015
Plugin ID:
4645
Plugin Version:
1.0.2
Plugin Category:
Statistical
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Easy Rank SQL is a ranking system that uses MySQL, an easy way to get ranking on your Team Fortress 2 server (SQL Rank)
    Old 05-24-2015 , 00:04   [TF2] Easy Rank SQL
    Reply With Quote #1

    Easy Rank SQL is a ranking system that uses MySQL, an easy way to get ranking on your Team Fortress 2 server

    HOW THIS PLUGIN WORKS
    • Every time you kill a player, you will get X points, these points can be configured using cvars.
    • If you only assist someone, you will get less points, but if you are playing as medic, you'll get the same points like killing someone.
    • And if you die, you lose some points from your score.

    FEATURES
    • Update player name on sm_easyrank table if player changed name or joined in your server with different one.
    • Automatically remove banned players from rank.
    • All SQL Queries are safe, your server will not crash or get compromised by using this plugin.
    • Don't count anything like flag captures and game objectives.
    • Has a "TOP 10 players" menu (see the screenshot).
    • Anti SQL queries spam, you have to wait 10 seconds to use !rank command again.
    • Show players score, position and total of players.
    • Create SQL tables automatically.

    CVARS
    • sm_easyrank_enable [0/1] - Set to 1 to enable or 0 to disable EasyRank (Default 1).
    • sm_easyrank_scorekill 10 - Set how many points you will earn on killing players (default 10).
    • sm_easyrank_scoreassist 5 - Set how many points you will earn on assists (default 5).
    • sm_easyrank_scoreassist_medic 10 - Set how many points you will earn on assists playing as medic (default: 10).
    • sm_easyrank_scoredeath 3 - Set how many points you will lose on deaths (default 3).

    There is some commands that can be used to administrate your rank:

    ADMIN COMMANDS
    • sm_easyrank_sync - Sync your database, use it only if you have done changes on SQL rank manually.
    • sm_easyrank_reset_id - Reset player score by SteamID 3 (example sm_easyrank_reset_id "[U:1:66789468]").
    • sm_easyrank_reset_all - Erase EVERYTHING on rank table. You MUST confirm this action.

    PLAYER COMMANDS
    • !rank - Display player score, position, total of players and TOP 10 menu

    MENU EXAMPLE



    INSTALLATION
    • Download easyrank.smx or compile easyrank.sp and copy to your plugins folder.
    • You MUST have a working MySQL server configured on Sourcemod.
    • This plugin uses "Default" database, and automatically create "sm_easyrank" table, if you need to use another database, just change in the plugin and compile by yourself.
    • Load the plugin on your server, "sm plugins load easyrank"
    • No need to restart.

    CHANGELOG
    • 1.0.2 - Implemented SQL_EscapeString and terminate garbage strings.
    Attached Images
    File Type: jpg easyrank-1.0.2.jpg (74.7 KB, 4321 views)
    Attached Files
    File Type: sp Get Plugin or Get Source (easyrank.sp - 2388 views - 21.5 KB)

    Last edited by renancavalieri; 06-10-2015 at 13:41. Reason: Updated
    renancavalieri is offline
    renancavalieri
    AlliedModders Donor
    Join Date: Feb 2015
    Old 05-24-2015 , 00:06   Re: [TF2] Easy Rank SQL
    Reply With Quote #2

    [ reserved for major changelogs ]

    Last edited by renancavalieri; 06-10-2015 at 13:30.
    renancavalieri is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 06-07-2015 , 21:31   Re: [TF2] Easy Rank SQL
    Reply With Quote #3

    Please look at SQL_EscapeString. Users can destroy your database with a bad name, or give bad arguments to your plugin...

    EDIT: Also, you need to check the returns from your String Initialization functions if you're using decl.

    Last edited by KyleS; 06-07-2015 at 21:36.
    KyleS is offline
    renancavalieri
    AlliedModders Donor
    Join Date: Feb 2015
    Old 06-10-2015 , 13:32   Re: [TF2] Easy Rank SQL
    Reply With Quote #4

    Quote:
    Originally Posted by KyleS View Post
    Please look at SQL_EscapeString. Users can destroy your database with a bad name, or give bad arguments to your plugin...

    EDIT: Also, you need to check the returns from your String Initialization functions if you're using decl.
    Fixed on 1.0.2, now are safe
    renancavalieri is offline
    mysty
    Member
    Join Date: Oct 2015
    Location: FUCK OFF
    Old 12-20-2015 , 09:19   Re: [TF2] Easy Rank SQL
    Reply With Quote #5

    I'm trying to query the ranks for players and assign them tags using Simple Chat Processor. I've been figuring out for the whole day. Please help.

    Code:
    GetRank(client)
    {
    	decl String:clientid[32], String:query[256];
        clientid[0] = '\0'; query[0] = '\0'; 
        
        GetClientAuthId(client, AuthId_Steam3, clientid, sizeof(clientid));
    	
    	new String:sqlstring[255];
    	Format(sqlstring, sizeof(sqlstring), "SELECT COUNT(*) OVER(ORDER BY score DESC) FROM ranks WHERE steamid = %s", clientid);
    	
    	new Handle:hndl = SQL_Query(db, sqlstring);
    	SQL_FetchRow(hndl);
    	rank[client] = SQL_FetchInt(hndl, 0);
    	CloseHandle(hndl);
    
    	new String:getrank[64];
    	Format(getrank, sizeof(getrank), "%i", rank[client]);
    	SetClientCookie(client, c_tag, getrank);
    }
    I'm new to sql ><
    mysty is offline
    nerdy97
    Member
    Join Date: Jul 2013
    Location: Sydney, Australia
    Old 10-27-2016 , 03:43   Re: [TF2] Easy Rank SQL
    Reply With Quote #6

    Having some issues where sometimes player ranks reset. They also haven't been banned or silenced. Any reason why?
    __________________
    nerdy97 is offline
    TitanTF
    Senior Member
    Join Date: Mar 2016
    Location: Singapore
    Old 10-27-2016 , 14:34   Re: [TF2] Easy Rank SQL
    Reply With Quote #7

    Quote:
    Originally Posted by nerdy97 View Post
    Having some issues where sometimes player ranks reset. They also haven't been banned or silenced. Any reason why?
    same here :/
    TitanTF is offline
    TheeOP
    New Member
    Join Date: Jul 2018
    Old 07-11-2018 , 18:34   Re: [TF2] Easy Rank SQL
    Reply With Quote #8

    L 07/11/2018 - 15:29:44: [easyrank.smx] [EasyRank] Could not connect to default database: [2003]: Can't connect to MySQL server on 'localhost' (10061)


    do you know how to fix this? im new to mysql
    TheeOP is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


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


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