View Single Post
Sajmooooon
Senior Member
Join Date: Nov 2018
Location: Slovakia
Old 06-08-2019 , 17:20   Re: [REQ]Can someone edit this plugin?
Reply With Quote #3

Quote:
Originally Posted by Nexd View Post
PHP Code:
#include <sourcemod>
#include <store>

#define PLUGIN_NEV    "Store top25 player"
#define PLUGIN_LERIAS    "https://forums.alliedmods.net/showthread.php?t=316749"
#define PLUGIN_AUTHOR    "Nexd"
#define PLUGIN_VERSION    "1.0"
#pragma tabsize 0

Database g_DB;
ConVar g_adatbazis;

public 
Plugin myinfo 
{
    
name PLUGIN_NEV,
    
author PLUGIN_AUTHOR,
    
description PLUGIN_LERIAS,
    
version PLUGIN_VERSION
};

public 
void OnPluginStart()
{
    
g_adatbazis CreateConVar("sm_store_db""store""Database for the plugin");

    
RegConsoleCmd("sm_storetop"Command_StoreTop);
}

public 
void OnConfigsExecuted() {
    
char error[255];
    
char database[32];
    
GetConVarString(g_adatbazisdatabasesizeof(database));
    
g_DB SQL_Connect(databasetrueerrorsizeof(error));
}

public 
Action Command_StoreTop(int clientint args)
{
    
GetStoreTopPlayers(client);
}

public 
Action GetStoreTopPlayers(int client) {
    
char Query[1024];
    
Format(Querysizeof(Query), "SELECT name, credits FROM store_players ORDER BY credits DESC limit 25;");
        
    
SQL_TQuery(g_DBCreateTopListQueryclient);
    return 
Plugin_Handled;
}

public 
void CreateTopList(Handle ownerHandle hndl, const char[] errorany data) {
    
int client data;
    
char name[128];
    
int credits;
    
Menu topcredits CreateMenu(Nullmenuhandler);
    
SetMenuTitle(topcredits"Top 25 credits");
    while (
SQL_FetchRow(hndl)) {
        
SQL_FetchString(hndl0namesizeof(name));
        
credits SQL_FetchInt(hndl1);
        
Format(namesizeof(name), "%s - %i"namecredits);
        
AddMenuItem(topcredits""nameITEMDRAW_DISABLED);
    }

    
DisplayMenu(topcreditsclient60);
}

public 
int Nullmenuhandler(Handle menuMenuAction actionint clientint item)
{

Thanks
Sajmooooon is offline