Raised This Month: $51 Target: $400
 12% 

Admin chat usign @


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 02-28-2012 , 12:59   Admin chat usign @
Reply With Quote #1

Hi,

I want my wierdo's so be able to see and use the admin chat too , heres my code :

PHP Code:
public cmdSayAdmin(id)
{
    new 
said[1]
    
read_argv(1said1)
    
    if (
said[0] != '@')
        return 
PLUGIN_CONTINUE
    
    
new message[192], name[32], authid[32], userid
    
new players[32], inum
    
    read_args
(message191)
    
remove_quotes(message)
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    
userid get_user_userid(id)
    
    
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^""nameuseridauthidmessage[1])
    
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")"nameuseridauthidmessage[1])
    
    if ( 
get_user_flags(id) & ADMIN_LEVEL_A)
    {
        
format(message191"(%L) %s :  %s"id"ADMIN"namemessage[1])
    }
    else if (
get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
format(message191"(WIERDO) %s :  %s"namemessage[1])
    }
    else
    {
        
format(message191"(%L) %s :  %s"id"PLAYER"namemessage[1])
    }

    
get_players(playersinum)
    
    for (new 
0inum; ++i)
    {
        
// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
        
if (players[i] != id && get_user_flags(players[i]) & ADMIN_LEVEL_A || ADMIN_LEVEL_H)
            
client_print(players[i], print_chat"%s"message)
    }
    
    
client_print(idprint_chat"%s"message)
    
    return 
PLUGIN_HANDLED

It double prints the chat
EpicMonkey is offline
Reply



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 05:21.


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