Raised This Month: $ Target: $400
 0% 

Is it possible fail state ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 12-27-2015 , 04:49   Re: Is it possible fail state ?
Reply With Quote #6

Quote:
Originally Posted by siriusmd99 View Post
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(PLUGINVERSIONAUTHOR)
          
    if(!
is_auth_admin)                   
                 
set_fail_state("[%s] You're not allowed to use this plugin!"PLUGIN)

}

bool:is_auth_admin(){
    
    static 
u_Flagsu_Countu_Acces
    u_Count
=admins_num()
      
    for (new 
0u_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(STEAMAuthData)) && (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 ?
Awesome_man is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode