Raised This Month: $ Target: $400
 0% 

Hook events "say" and "say_team"


Post New Thread Reply   
 
Thread Tools Display Modes
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
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 12-21-2009 , 23:38   Re: Hook events "say" and "say_team"
Reply With Quote #2

Why you post this on all seccion.

You Fail!!

PD: I answered in "Others" SubForum.,
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-22-2009 , 01:10   Re: Hook events "say" and "say_team"
Reply With Quote #3

Instead of return PLUGIN_HANDLED, return PLUGIN_HANDLED_MAIN
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-22-2009 , 06:34   Re: Hook events "say" and "say_team"
Reply With Quote #4

Quote:
Originally Posted by AntiBots View Post
Why you post this on all seccion.

You Fail!!

PD: I answered in "Others" SubForum.,
[ES] Porque yo habia posteado , pero no me habian contestado .

#ConnorMcLeod:

Hey! work perfect! Thanks ^^
__________________
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
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-22-2009 , 13:17   Re: Hook events "say" and "say_team"
Reply With Quote #5

Sorry for the double post.
I have another problem -.-. The living can read the dead and the living dead read, you can avoid this?
__________________
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
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-22-2009 , 13:34   Re: Hook events "say" and "say_team"
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Instead of return PLUGIN_HANDLED, return PLUGIN_HANDLED_MAIN
im a novice, could you explain whats the difference between just handle versus handled_main?

(edited)
thanks arkshine XD
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE

Last edited by laziboi72; 12-22-2009 at 13:54.
laziboi72 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-22-2009 , 13:40   Re: Hook events "say" and "say_team"
Reply With Quote #7

PLUGIN_HANDLED will block all the chat for plugins declared below this one. PLUGIN_HANDLED_MAIN will block only for your plugin.
__________________
Arkshine is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-22-2009 , 13:58   Re: Hook events "say" and "say_team"
Reply With Quote #8

Can Any help me with my problem ?
__________________
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
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 04:04.


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