My code:
PHP Code:
#include <sourcemod>
#include <sdktools>
new Handle:DB = INVALID_HANDLE;
public OnPluginStart()
{
I_DB();
RegConsoleCmd("sm_sss", Command);
RegConsoleCmd("sm_ssss", Command2);
}
public I_DB()
{
new String:error[255];
DB = SQLite_UseDatabase("timer", error, sizeof(error));
new String:query[512];
if (DB == INVALID_HANDLE)
{
PrintToServer("Could not connect to skillrank: %s", error);
}
else
{
SQL_FastQuery(DB, "CREATE TABLE IF NOT EXISTS 'Players' ( 'steamId' VARCHAR(32) NOT NULL PRIMARY KEY)");
if (!SQL_Query(DB, query))
{
SQL_GetError(DB, error, sizeof(error));
PrintToServer("Failed to query (error: %s)", error);
}
else
{
PrintToServer("table Players created if it didn't already exist");
}
}
}
public Action:Command(client, args)
{
if (IsClientInGame(client))
{
decl String:query[200];
decl String:steamId[30];
GetClientAuthString(client, steamId, sizeof(steamId));
Format(query, sizeof(query), "INSERT INTO 'Players' ( 'steamId') VALUES ( '%s')", steamId);
PrintToChatAll("123");
SQL_FastQuery(DB, query);
}
}
Command3(client)
{
new String:error[255], String:steamId[32];
DB = SQL_Connect("timer", true, error, sizeof(error));
new String:query[512];
new Handle:results;
GetClientAuthString(client, steamId, sizeof(steamId));
if (DB == INVALID_HANDLE)
{
PrintToServer("Could not connect to timer: %s", error);
}
CloseHandle(DB);
}
public Action:Command2(client, args)
{
Command3(client);
}
Me an error: Configuration "timer" not found
Why?