Raised This Month: $ Target: $400
 0% 

Admin Counting [HELP FAST PLEASE]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Trafikkz
Junior Member
Join Date: Apr 2010
Old 11-17-2010 , 12:25   Admin Counting [HELP FAST PLEASE]
Reply With Quote #1

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "WATF Check"
#define VERSION "1.0"
#define AUTHOR "Trafikk"

new maxplayers;
new admincvar;


public plugin_init() {
    
    register_plugin(PLUGIN, VERSION, AUTHOR);
    maxplayers = get_maxplayers();
    admincvar = register_cvar("amx_showadmins","1");
    
}

public onclientconnect(id) { 
    
    new id, count
    
    for(id = 1 ; id <= maxplayers ; id++) 
        if(is_user_connected(id)) 
        if(get_user_flags(id) & ADMIN_KICK) 
        count++
    
    if(get_pcvar_num(admincvar) == 1)
    {
        if (count==1) {
            new flags = read_flags("bz");
            set_user_flags(id,flags);
        }
    }
    
}
This is the code of a plugin. There are no errors or other when I compile it but it doesn't work.

This plugin should be a plugin who counts the admins online when a player connects. Well, I used the code from /admin command for this one.

When a player connects, the code it's counting the admins online, if there is an admin online the plugin will automatically set him to bz, otherwise he will keep the admin access (if he is admin).

What I'm wanting to do is, a plugin when an admin is connecting, if there is an admin online his admin won't be available, his access will be set to "bz", otherwise, if isn't any admin online he will keep his access. I really need help, I don't know what's wrong!?
Trafikkz 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 11:19.


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