AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   colortext (https://forums.alliedmods.net/showthread.php?t=87459)

biscuit628 03-12-2009 07:10

colortext
 
I need help with this code,
i add the sayteam,but it doesn't print with colortext,
only print the normal text..
don't call me to use allchat

sorry for my poor english.:mrgreen:
PHP Code:

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

#define PLUGIN_NAME "Colored Sign Chat"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Arvy"

new g_iMaxPlayers

public plugin_init(){
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
register_clcmd("say","sign_say",ADMIN_ALL,"- Colored Sign Chat")
register_clcmd("say_team","sayteam",ADMIN_ALL,"- Colored Sign Chat")
g_iMaxPlayers get_maxplayers()
}





public 
client_color(playeridcoloridmsg[]){
    
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),{0,0,0},playerid)
    
write_byte(colorid)
    
write_string(msg)
    
message_end()
}


public 
sign_say(id){

new 
text[64],name[32],message[128]
read_args (text,63)
remove_quotes(text)
get_user_name(id,name,31)

if ((
get_user_flags(id) & ADMIN_BAN)){
    if(
is_user_alive(id))
        {
        
format(message,127,"^x04[ADMIN] ^x03%s^x04 : %s",name,text)
        
client_color(0,id,message);
        }
    if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*DEAD* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
        
client_color(0,id,message);
        }
    else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*SPEC* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
        
client_color(0,id,message);
        }
    }
else {
    if(
is_user_alive(id))
        {
        
format(message,127,"^x03%s^x01 : %s",name,text)
        
client_color(0,id,message);
        }
    if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*DEAD* ^x03%s^x01 : %s",name,text)
        
client_color(0,id,message);
        }
    else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
        {
        
format(message,127,"^x03*SPEC* ^x03%s^x01 : %s",name,text)
        
client_color(0,id,message);
        }
    }
return 
PLUGIN_HANDLED
}

public 
sayteam(id){
new 
text[64],name[32],message[128]
read_args (text,63)
remove_quotes(text)
get_user_name(id,name,31)

for(new 
<= g_iMaxPlayers i++){
if(
is_user_connected(i) && (cs_get_user_team(id) == cs_get_user_team(i))){
    if ((
get_user_flags(id) & ADMIN_BAN))
    {
        if(
is_user_alive(id))
            {
            
format(message,127,"(TEAM)^x04[ADMIN] ^x03%s^x04 : %s",name,text)
            
client_color(i,id,message);
            }
        if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*DEAD* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
            
client_color(i,id,message);
            }
        else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*SPEC* ^x04[ADMIN] ^x03%s^x04 : %s",name,text)
            
client_color(i,id,message);
            }
    }
    else {
        if(
is_user_alive(id))
            {
            
format(message,127,"(Team)^x03%s^x01 : %s",name,text)
            
client_color(i,id,message);
            }
        if(!
is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*DEAD* ^x03%s^x01 : %s",name,text)
            
client_color(i,id,message);
            }
        else if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
            {
            
format(message,127,"(Team)^x03*SPEC* ^x03%s^x01 : %s",name,text)
            
client_color(i,id,message);
            }
    }
}

}
return 
PLUGIN_HANDLED
}



/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg950\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset136 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1028\\ f0\\ fs16 \n\\ par }
*/ 


BOYSplayCS 03-12-2009 07:15

Re: colortext
 
Don't create another function for say_team.

Just use this:

PHP Code:

register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"


biscuit628 03-12-2009 07:31

Re: colortext
 
Quote:

Originally Posted by BOYSplayCS (Post 778950)
Don't create another function for say_team.

Just use this:

PHP Code:

register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"


i need that teamsay function so I create that..

BOYSplayCS 03-12-2009 08:52

Re: colortext
 
I didn't mean that. Here, just replace your original register_clcmd("say_team") with this:

PHP Code:

register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"


biscuit628 03-12-2009 17:13

Re: colortext
 
Quote:

Originally Posted by BOYSplayCS (Post 778998)
I didn't mean that. Here, just replace your original register_clcmd("say_team") with this:

PHP Code:

register_clcmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"


if i replace with this,
teamsay will become allchat

BOYSplayCS 03-12-2009 18:05

Re: colortext
 
Change the clcmd to a concmd.

biscuit628 03-12-2009 18:16

Re: colortext
 
Quote:

Originally Posted by BOYSplayCS (Post 779303)
Change the clcmd to a concmd.

PHP Code:

register_clcmd("say_team","sayteam",ADMIN_ALL,"- Colored Sign Chat"

to
PHP Code:

register_concmd("say_team","sayteam",ADMIN_ALL,"- Colored Sign Chat"

:?:

after i try,
it's nothing to do with the sayteam colortext..still print the nomaltext
my problem is that,
i can't print the sayteam in colortext..

BOYSplayCS 03-12-2009 18:18

Re: colortext
 
PHP Code:

register_concmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"

Try it, test it - run it.

biscuit628 03-12-2009 18:26

Re: colortext
 
Quote:

Originally Posted by BOYSplayCS (Post 779312)
PHP Code:

register_concmd("say_team","sign_say",ADMIN_ALL,"- Colored Sign Chat"

Try it, test it - run it.

http://img.photobucket.com/albums/v674/Death628/say.jpg
tested.not work

BOYSplayCS 03-12-2009 18:36

Re: colortext
 
I'm not so sure you can edit the "Team Say". I may be wrong though, someone prove me wrong.


All times are GMT -4. The time now is 08:57.

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