Raised This Month: $ Target: $400
 0% 

Hook events "say" and "say_team"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-21-2009 , 22:39   Hook events "say" and "say_team"
Reply With Quote #1

Today I was looking at this code starsailor.

PHP Code:
#include <amxmodx> 

new MsgSayText 

public plugin_init() 

    
MsgSayText get_user_msgid("SayText"
    
register_clcmd("say""hook_sayteam")
    
register_clcmd("say_team""hook_sayteam"



public 
hook_sayteam(id

    new 
Players[32], iPnumiIndexiTeam 
    get_players
(PlayersiPnum
     
    for (new 
0iPnumi++) 
    { 
        
iIndex Players[i
         
        new 
Said[200
         
        
read_args(Said,199
        
remove_quotes(Said
        
trim(Said
         
        new 
szName[32
        
get_user_name(idszName31
         
        
iTeam get_user_team(iIndex
         
        if(
iIndex && get_user_team(id) == iTeam
        { 
            
chat_color(iIndex"!y(%d) !t%s !y: %s",iTeam == 2,szName,Said
        } 
    } 
     
    return 
PLUGIN_HANDLED


stock chat_color(const id, const string[], { FloatSqlResul}:...) 

    new 
msg[191], players[32], count 1
    
vformat(msgsizeof msg 1string3); 
     
    
replace_all(msgsizeof msg 1"!g""^4"
    
replace_all(msgsizeof msg 1"!y""^1"
    
replace_all(msgsizeof msg 1"!t""^3"
     
    if(
id
    { 
        
players[0] = id
    } 
    else 
    { 
        
get_players(playerscount"ch"
    } 
    for (new 
count i++) 
    { 
        new 
index players[i
        
message_begin(MSG_ONE_UNRELIABLEMsgSayText_index
        
write_byte(index
        
write_string(msg
        
message_end() 
    } 

Now, a problem if I try to talk to admin (@ @), the Tsay csay or not present, someone can help me?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
 



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 04:04.


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