AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ SOLVED ] [ Duplicate Say ] (https://forums.alliedmods.net/showthread.php?t=254915)

Xablau 01-08-2015 05:28

[ SOLVED ] [ Duplicate Say ]
 
I have bug :(
Duplicate say on green chat

PHP Code:

public plugin_init() 
{
    
register_clcmd("say""handle_say")
}
public 
handle_say(id)
{
    new 
message[192]
    
read_args(message191)
    
remove_quotes(message)
    
    new 
name[32]
    
get_user_name(idname31)
    
    new 
alive is_user_alive(id)
    
    if(
alive)
        
format(message191"^x03%s^x01 : ^x04 %s"namemessage)
    else
        
format(message191"^x01*DEAD* ^x03%s^x01 : ^x04 %s"namemessage)
    
    for(new 
1<= gMaxPlayersi++)
    {
        if(!
is_user_connected(i))
            continue
    
        if(
alive && is_user_alive(i) || !alive && !is_user_alive(i)) // Prints the message
        
{
            
message_begin(MSG_ONEgMsgSayText, {000}, i)
            
write_byte(id)
            
write_string(message)
            
message_end()
        }
    }
    return 
PLUGIN_CONTINUE




All times are GMT -4. The time now is 15:23.

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