Raised This Month: $ Target: $400
 0% 

Help with scripting..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Severinsen7
Member
Join Date: May 2010
Location: Denmark
Old 10-28-2010 , 21:55   Help with scripting..
Reply With Quote #1

Hi there.
Can some1 tell me how I make this different?

Code:
#include <amxmodx>

/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_KICK

static const COLOR[] = "^x04" //green
static const CONTACT[] = "Severinsen7"
/*----------------------------------------*/

new maxplayers
new gmsgSayText

public plugin_init() {
    register_plugin("Admin Check", "1.51", "OneEyed")
    maxplayers = get_maxplayers()
    gmsgSayText = get_user_msgid("SayText")
    register_clcmd("say", "handle_say")
    register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
}

public handle_say(id) {
    new said[192]
    read_args(said,192)
    if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 )
        set_task(0.1,"print_adminlist",id)
    return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
    new adminnames[33][32]
    new message[256]
    new contactinfo[256], contact[112]
    new id, count, x, len
    
    for(id = 1 ; id <= maxplayers ; id++)
        if(is_user_connected(id))
            if(get_user_flags(id) & ADMIN_CHECK)
                get_user_name(id, adminnames[count++], 31)

    len = format(message, 255, "%s Admins Online: ",COLOR)
    if(count > 0) {
        for(x = 0 ; x < count ; x++) {
            len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
            if(len > 96 ) {
                print_message(user, message)
                len = format(message, 255, "%s ",COLOR)
            }
        }
        print_message(user, message)
    }
    else {
        len += format(message[len], 255-len, "None.")
        print_message(user, message)
    }
    
    get_cvar_string("amx_contactinfo", contact, 63)
    if(contact[0])  {
        format(contactinfo, 111, "%s Contact @Steam: %s", COLOR, contact)
        print_message(user, contactinfo)
    }
}

print_message(id, msg[]) {
    message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
    write_byte(id)
    write_string(msg)
    message_end()
}
I would like it to be like:

(green)Admins Online(green) (red/blue)None.(red/blue)
(green)Contact @Steam(green) (red/blue)Severinsen7(red/blue)

Red/blue = (Depending on teams, if you are terrorist its red if you are ct its blue)
__________________
[IMG]http://img715.**************/img715/3512/sevensigmu1.jpg[/IMG]
Severinsen7 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 01:35.


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