AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin check color (https://forums.alliedmods.net/showthread.php?t=77297)

AntiBots 09-09-2008 22:37

Admin check color
 
Hi, Someone can help me??
I want that "ADMIN ONLINE" in normal color, and "nombres of Admins Blue" and ( , ) Red. I do but dont work :D

Thanks here the code:

PHP Code:

#include <amxmodx>
/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_KICK
static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
/*----------------------------------------*/
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"CONTACTFCVAR_SERVER)
}
public 
handle_say(id) {
 new 
said[192]
 
read_args(said,192)
 if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
  
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 
idcountxlen
 
 
for(id id <= maxplayers id++)
  if(
is_user_connected(id))
   if(
get_user_flags(id) & ADMIN_CHECK)
    
get_user_name(idadminnames[count++], 31)
 
len format(message255"%s ADMINS ONLINE: ",COLOR)
 if(
count 0) {
  for(
count x++) {
   
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
   if(
len 96 ) {
    
print_message(usermessage)
    
len format(message255"%s ",COLOR)
   }
  }
  
print_message(usermessage)
 }
 else {
  
len += format(message[len], 255-len"No admins online.")
  
print_message(usermessage)
 }
 
 
get_cvar_string("amx_contactinfo"contact63)
 if(
contact[0])  {
  
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
  
print_message(usercontactinfo)
 }
}
print_message(idmsg[]) {
 
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
 
write_byte(id)
 
write_string(msg)
 
message_end()



Prajch 09-10-2008 02:12

Re: Admin check color
 
At a glance here's one problem:

PHP Code:

new said[192]
 
read_args(said,192

should be

PHP Code:

new said[192]
 
read_args(said,191


anakin_cstrike 09-10-2008 19:56

Re: Admin check color
 
Well...try it.
PHP Code:

#include <amxmodx>
/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_KICK
static const COLOR[] = "^x03" 
static const CONTACT[] = ""
/*----------------------------------------*/
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"CONTACTFCVAR_SERVER)
}
public 
handle_say(id) {
    new 
said[192]
    
read_args(said,191)
    if( ( 
containi(said"who") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
        
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 
idcountxlen
 
    
for(id id <= maxplayers id++)
    {
        if(
is_user_connected(id))
        if(
get_user_flags(id) & ADMIN_CHECK)
        
get_user_name(idadminnames[count++], 31)
    }
    
len format(message255"^x01 ADMINS ONLINE: ")
    if(
count 0) {
        for(
count x++) {
            
len += format(message[len], 255-len"^x03 %s%s "adminnames[x], < (count-1) ? ", ":"")
            if(
len 96 ) {
                
print_message(usermessage)
                
len format(message255"%s ",COLOR)
            }
        }
        
print_message(usermessage)
    } else {
        
len += format(message[len], 255-len"No admins online.")
        
print_message(usermessage)
    }
 
    
get_cvar_string("amx_contactinfo"contact63)
    if(
contact[0])  {
        
format(contactinfo111"%s Contact Server Admin -- %s"COLORcontact)
        
print_message(usercontactinfo)
    }
}
print_message(idmsg[]) {
 
message_begin(MSG_ONEgmsgSayText, {0,0,0}, id)
 
write_byte(id)
 
write_string(msg)
 
message_end()


...You want to print the admins online with red color?

AntiBots 09-10-2008 20:56

Re: Admin check color
 
Thank :D +Karma


All times are GMT -4. The time now is 03:14.

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