public OnMapStart()
{
ClearArray(g_Name);
ClearArray(g_SteamID);
ClearArray(g_IP);
ResetSettings();
new Handle:hKVReasons;
hKVReasons = CreateKeyValues("SourceBans");
decl String:strBuffer[256];
BuildPath(Path_SM, strBuffer, sizeof(strBuffer), "configs/sourcebans/sourcebans.cfg");
if(FileToKeyValues(hKVReasons, strBuffer))
{
KvJumpToKey(hKVReasons, "BanReasons", false);
do
{
// тут нужно получать параметры.
}
while (KvGotoNextKey(hKVReasons));
}
CloseHandle(hKVReasons);
}
"SourceBans"
{
"Config"
{
// Website address to tell where the player to go for unban, etc
"Website" "http://****"
// Allow or disallow admins access to addban command
"Addban" "1"
// Allow or disallow admins access to unban command
"Unban" "1"
// The Tableprefix you set while installing the webpanel. (default: "sb")
"DatabasePrefix" "sb"
// How many seconds to wait before retrying when a players ban fails to be checked. Min = 15.0 Max = 60.0
"RetryTime" "45.0"
// How often should we process the failed ban queue in minutes
"ProcessQueueTime" "5"
// Should the plugin automaticaly add the server to sourcebans
// (servers without -ip being set on startup need this set to 0)
"AutoAddServer" "1"
// Enable backing up config files after getting admins from database (1 = enabled, 0 = disabled)
"BackupConfigs" "1"
// Enable admin part of the plugin (1 = enabled, 0 = disabled)
"EnableAdmins" "1"
// Require the admin to login once into website
"RequireSiteLogin" "0"
// This is the ID of this server (Check in the admin panel -> servers to find the ID of this server)
"ServerID" "1"
}
"BanReasons"
{
"Hacking" "Hacking"
"Exploit" "General Exploit of Game/Map/Server"
"TK" "Team Killing"
"TF" "Team Flashing"
"CommSpam" "Spamming Mic/Chat"
"BadSpray" "Inappropriate Spray"
"BadLang" "Inappropriate Language"
"BadName" "Inappropriate Name"
"IgnoreAdmin" "Ignoring Admins"
"Stacking" "Team Stacking"
"Own Reason" "Own Reason"
}
}
BrowseKeyValues(Handle:kv)
{
do
{
// You can read the section/key name by using KvGetSectionName here.
if (KvGotoFirstSubKey(kv, false))
{
// Current key is a section. Browse it recursively.
BrowseKeyValues(kv);
KvGoBack(kv);
}
else
{
// Current key is a regular key, or an empty section.
if (KvGetDataType(kv, NULL_STRING) != KvData_None)
{
// Read value of key here (use NULL_STRING as key name). You can
// also get the key name by using KvGetSectionName here.
}
else
{
// Found an empty sub section. It can be handled here if necessary.
}
}
} while (KvGotoNextKey(kv, false));
}
"somekv"
{
"level1"
{
"level2"
{
"key1" "value1"
}
}
}