Raised This Month: $ Target: $400
 0% 

getting team adn hook say


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
COre^
Member
Join Date: Dec 2008
Old 09-11-2012 , 16:03   getting team adn hook say
Reply With Quote #1

Hy everyone, i was working in this plugins, but it doesnt work. what i want is to hook say so as to only show it as if it was say_team. heres the code.

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Hook Say"
#define VERSION "1.0"
#define AUTHOR "AntiChupines"

new SayTextMaxPlayers


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""message_saytext")
    
    
SayText get_user_msgid("SayText")
    
MaxPlayers get_maxplayers()

}

public 
message_saytext(id)
{

    static 
szSay[195]

    
read_args(szSaycharsmax(szSay))
    
remove_quotes(szSay)
    
    static 
szNombre[33]
    
get_user_name(idszNombre32)
    
    for(new 
1MaxPlayersi++)
    {
        new 
iTeam cs_get_user_team(i)
    
        switch(
iTeam)
        {
            case 
CS_TEAM_T:
            {
                if(!
is_user_alive(i)) {
                    
ChatColor(i"!y*DEAD*(Terrorist) !t%s !y: %s"szNombreszSay)
                }
                else
                {
                    
ChatColor(i"!y(Terrorist) !t%s !y: %s"szNombreszSay)
                }
            }
    
            case 
CS_TEAM_CT:
            {
                if(!
is_user_alive(i)) {
                    
ChatColor(i"!y*DEAD*(Counter-Terrorist) !t%s !y: %s"szNombreszSay)
                }
                else
                {
                    
ChatColor(i"!y(Counter-Terrorist) !t%s !y: %s"szNombreszSay)
                }
            }
    
            case 
CS_TEAM_SPECTATOR:
            {
                    
ChatColor(i"!y(Spectator) !t%s !y: %s"szNombreszSay)

            }
        }
    }
        
    return 
PLUGIN_HANDLED

}

stock ChatColor(const id, const input[], any:...) 
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^x04")
    
replace_all(msg190"!y""^x01")
    
replace_all(msg190"!t""^x03")
    
    if(
id)
        
players[0] = id
    
else
    
get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLESayText_players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

EDIT: Ive edit the code but its still doesnt work.

Last edited by COre^; 09-11-2012 at 18:52.
COre^ is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-11-2012 , 19:55   Re: getting team adn hook say
Reply With Quote #2

It's much simpler than that to make all "say" chat go through "say_team" chat.

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("No Public chat""0.1""Ford Prefect")
    
register_clcmd("say""cmdSay")
}

public 
cmdSay(id)
{
    static 
szSaid[128]
    
read_args(szSaidcharsmax(szSaid))
    
engclient_cmd(id"say_team"szSaid)
    return 
PLUGIN_HANDLED

__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 08:13.


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