Code:
#define DEBUG
#define PLUGIN_AUTHOR "Alex"
#define PLUGIN_VERSION "1.00"
#include <sourcemod>
#include <sdktools>
#include <cstrike>
//#include <sdkhooks>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "BattlePass",
author = PLUGIN_AUTHOR,
description = "BattlePass plugin :)",
version = PLUGIN_VERSION,
};
public void OnPluginStart() {
char error[255];
Database db = SQL_Connect("battlepass", true, error, sizeof(error));
if (db == null)
{
PrintToServer("Could not connect: %s", error);
}
else
{
PrintToServer("Conectare reusita");
}
RegAdminCmd("sm_give_bp", CmdBp, ADMFLAG_ROOT, "");
}
public Action CmdBp(int client, int args) {
if (args < 1) {
ReplyToCommand(client, "Foloseste : sm_give_bp <nume>");
return Plugin_Handled;
}
char arg1[32];
GetCmdArg(1, arg1, 32);
char name[32];
GetClientName(client, name, 32);
char query[200];
PrintToChat(client, "HH");
Format(query, 200, "INSERT INTO 'battlepass' (Test) VALUES ('%i')", sizeof(arg1));
return Plugin_Handled;
}
but if in game use sm_give_bp name.. in tabel dosent appear sizeof(arg1)