AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [REQ]Can someone edit this plugin? (https://forums.alliedmods.net/showthread.php?t=316749)

Sajmooooon 06-08-2019 11:59

[REQ]Can someone edit this plugin?
 
Hi, can someone edit this, please.

Here is that plugin: https://forums.alliedmods.net/showthread.php?t=265268

Nexd 06-08-2019 14:26

Re: [REQ]Can someone edit this plugin?
 
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)
{



Sajmooooon 06-08-2019 17:20

Re: [REQ]Can someone edit this plugin?
 
Quote:

Originally Posted by Nexd (Post 2654871)
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 :oops:


All times are GMT -4. The time now is 03:54.

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