#include <amxmodx>
#include <amxmisc>
#tryinclude <reapi>
#pragma semicolon 1
new const PLUGIN_NAME[] = "Auto Set Steam Flag";
new const PLUGIN_VERSION[] = "1.0.0";
new const PLUGIN_AUTHOR[] = "w0w";
/****************************************************************************************
****************************************************************************************/
new const g_szConfigName[] = "auto_set_steam_flag";
new g_szAccess[32];
public plugin_init()
{
register_plugin(
.plugin_name = PLUGIN_NAME,
.version = PLUGIN_VERSION,
.author = PLUGIN_AUTHOR
);
new pCvar = create_cvar("auto_set_steam_flag", "t", FCVAR_NONE, "Flags to set");
bind_pcvar_string(pCvar, g_szAccess, charsmax(g_szAccess));
AutoExecConfig(true, g_szConfigName);
new szPath[PLATFORM_MAX_PATH];
get_configsdir(szPath, charsmax(szPath));
server_cmd("exec %s/plugins/%s.cfg", szPath, g_szConfigName);
server_exec();
}
public client_putinserver(id)
{
if(is_user_steam(id))
set_user_flags(id, read_flags(g_szAccess));
}
#if !defined _reapi_included
stock is_user_steam(id)
{
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id);
server_exec();
return (get_pcvar_num(dp_pointer) == 2) ? 1 : 0;
}
return 0;
}
#endif