 |
|
Senior Member
Join Date: May 2014
Location: singapore
|

12-27-2015
, 04:49
Re: Is it possible fail state ?
|
#6
|
Quote:
Originally Posted by siriusmd99
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "My Plugin"
#define VERSION "1.0"
#define AUTHOR "siriudmd99"
#define STEAMID "your steamid"
#define FLAGS "abcdefghijklmnopqrstu"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
if(!is_auth_admin)
set_fail_state("[%s] You're not allowed to use this plugin!", PLUGIN)
}
bool:is_auth_admin(){
static u_Flags, u_Count, u_Acces
u_Count=admins_num()
for (new i = 0; i < u_Count; ++i)
{
u_Flags=admins_lookup(i,AdminProp_Flags);
u_Access=admins_lookup(i,AdminProp_Access);
admins_lookup(i,AdminProp_Auth,AuthData,charsmax(AuthData));
if (u_Flags & FLAG_AUTHID) && (equal(STEAM, AuthData)) && (equal(FLAGS,u_Access)) return true;
}
return false;
}
Instead of "your steamid" put steam which you would like to check.
Edit: if you want to stop other plugins then use server_cmd("amx_pausecfg stop plugin_name.amxx") instead of set fail state.
|
Suppose there is a plugin named "abc.amxx" "ghj.amxx" how can dey be paused if particular steamid not an admin in user.ini file ?
|
|
|
|