|
Member
|
06-16-2016
, 01:31
Re: [REQ][CSGO] Limited server access by Points
|
#33
|
Quote:
Originally Posted by ElaMeMamou
Mate i tried but im getting this warning:
PHP Code:
#include <ckSurf>
#pragma semicolon 1
#define PLUGIN_VERSION "0.1"
public Plugin:myinfo = { name = "ckSurf Kicker", author = "DeweY", version = PLUGIN_VERSION, description = "Kicks clients with 1000 points or more.", url = "http://Omegagaming.org/" };
Handle g_hDatabase = null;
char g_sSteamID[MAXPLAYERS+1][64];
public void OnPluginStart() { SQL_TConnect(SQLCallback_Connect, "cksurf"); }
public SQLCallback_Connect(Handle owner, Handle hndl, const char[] error, any data) { if (hndl == null) { SetFailState("Error connecting to database. %s", error); }
g_hDatabase = hndl; }
public void OnClientPostAdminCheck(client) { GetClientAuthId(client, AuthId_Steam2, g_sSteamID[client], sizeof(g_sSteamID[])); CheckRank(client); }
public CheckRank(int client) { char query[255]; Format(query, 255, "SELECT `points` FROM `ck_playerrank` WHERE `steamid`='%s' LIMIT 1", g_sSteamID[client]); SQL_TQuery(g_hDatabase, SQLCallback_LoadPlayerPoints, query, GetClientUserId(client)); }
public SQLCallback_LoadPlayerPoints(Handle owner, Handle hndl, const char[] error, any data) { if (hndl == null) { SetFailState("Error grabbing player points. %s", error); }
int client = GetClientOfUserId(data);
if (SQL_GetRowCount(hndl) == 1) { SQL_FetchRow(hndl); int playerpoints = SQL_FetchInt(hndl, 0); if (playerpoints >= 1000) { if (GetAdminFlag(GetUserAdmin(client), Admin_Generic)) { return; } KickClient(client, "This server is for beginners."); } } }
|
Hello friend,can you add to this plugin a function to redirect to another server after kick???
|
|
|
|