hello guys can anyone help me upgrading
prometheus - Sourcemod Donation System from sourceban to sourceban++
PHP Code:
#tryinclude <sourcebans>
#tryinclude <sb_admins>
PHP Code:
// If Sourcebans is enabled, add them to the SB database
if (GetConVarInt(cvarMode) == 3)
{
if (LibraryExists("sb_admins")) SB_AddAdmin(0, name, AUTHMETHOD_STEAM, steamid, "", flGroup);
}
ServerCommand("sm_reloadadmins");
if (ccc) CreateTimer(3.0, ReloadCCC);
char broadcast[1024];
GetConVarString(cvarBroadcast, broadcast, sizeof(broadcast));
ReplaceString(broadcast, sizeof(broadcast), "PLAYER_NAME", name, true);
ReplaceString(broadcast, sizeof(broadcast), "DONATION_AMOUNT", dAmount, true);
ReplaceString(broadcast, sizeof(broadcast), "PACKAGE_NAME", packageName, true);
if (csgo) PrintToChatAll(broadcast);
else CPrintToChatAll(broadcast);
PrintToServer(broadcast);
return Plugin_Handled;
}
PHP Code:
public Action Timer_CheckInterval(Handle timer)
{
char strExpires[66], steamid[32];
Handle kvdb = CreateKeyValues("Prometheus");
Handle DB = CreateKeyValues("Admins");
FileToKeyValues(kvdb, KVPath);
if (!KvGotoFirstSubKey(kvdb)) return Plugin_Continue;
do
{
KvGetString(kvdb, "expire_time", strExpires, sizeof(strExpires));
if (GetTime() >= StringToInt(strExpires))
{
KvGetString(kvdb, "steamid", steamid, sizeof(steamid));
LogAction(0, -1, "%s is now expired, removing rank...", steamid);
if (GetConVarInt(cvarMode) == 1)
{
FileToKeyValues(DB, KVPathAdmins);
if (KvJumpToKey(DB, steamid, false))
{
KvDeleteThis(DB);
LogAction(0, -1, "%s's rank has been removed.", steamid);
}
}
if (GetConVarInt(cvarMode) == 2)
{
if (IsValidAdmin(steamid))
{
RemoveAdminFromDB(steamid);
LogAction(0, -1, "%s's rank has been removed.", steamid);
}
}
if (GetConVarInt(cvarMode) == 3)
{
SB_DeleteAdmin(0, AUTHMETHOD_STEAM, steamid);
LogAction(0, -1, "%s's rank has been removed.", steamid);
}
KvDeleteThis(kvdb);
}
} while (KvGotoNextKey(kvdb));
ServerCommand("sm_reloadadmins");
if (ccc) CreateTimer(3.0, ReloadCCC);
KvRewind(DB);
KeyValuesToFile(DB, KVPathAdmins);
CloseHandle(DB);
KvRewind(kvdb);
KeyValuesToFile(kvdb, KVPath);
CloseHandle(kvdb);
return Plugin_Continue;
}
i thing my problem in this codes but if not i will leave .sp file
thanks