AlliedModders

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

raducuursu 09-03-2013 10:43

Message
 
message_shower sma so I want to change it and put ColorChat of you attach far ColorChat
delete old ColorChat of sma and put it after include my
It is sma:

PHP Code:

#include < amxmodx >
#include < amxmisc >

#define PLUGIN "Messages Shower"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define ADVERTISING_TIME 60.0

stock const messages [ ] [ ] =
{
    
"mesaj",
      
"mesaj",
    
"mesaj",
    
"mesaj",
    
"mesaj"
}

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR )
    
    
set_task ADVERTISING_TIME"show_messages"___,"b" );
}

public 
show_messages ( )
{
    new 
Buffer[256];
    
formatex(Buffersizeof Buffer 1"^x04%s"messages[random(sizeof messages)]);
    
    new 
players[32], numid;
    
get_players(playersnum);
    
    for(new 
num i++)
    {
        
id players[i]
    
        
message_begin(MSG_ONEget_user_msgid("SayText"), _id);
        
write_byte(id);
        
write_string(Buffer);
        
message_end();
    }


it is chatcolor.inc
PHP Code:

#if defined _chatcolor_included
  #endinput
#endif
#define _chatcolor_included

#pragma reqlib chatcolor

enum _:Colors {
    
DontChange,
    
Red,
    
Blue,
    
Grey
}

native client_print_color(idiColor=DontChange, const szMsg[], any:...) 


bat 09-03-2013 11:38

Re: Message
 
Code:

#include < amxmodx >
#include < amxmisc >
#include <chatcolor>

#define PLUGIN "Messages Shower"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define ADVERTISING_TIME 60.0

stock const messages [ ] [ ] =
{
    "mesaj",
    "mesaj",
    "mesaj",
    "mesaj",
    "mesaj"
}

public plugin_init ( )
{
    register_plugin ( PLUGIN, VERSION, AUTHOR )
   
    set_task ( ADVERTISING_TIME, "show_messages", _, _, _,"b" );
}

public show_messages ( )
{
    client_print_color(0, Grey, "%s", messages[random(sizeof messages)])
}

I don't tested! include -> http://forums.alliedmods.net/showthread.php?p=851160

raducuursu 09-03-2013 14:23

Re: Message
 
Thanks

raducuursu 09-03-2013 14:36

Re: Message
 
is a problem, you put ^ 3 appears blue or red, I want to show gray

DWIGHTpN 09-03-2013 17:12

Re: Message
 
^1 = clientside color. (con_color rrr ggg bbb).
^3 = 2nd argument color (Grey,Red,Blue,DontChange)
client_print_color(1st arg, 2nd arg, 3rd arg, any:...);
^4 = Green.

Dyn ColorChat : http://forums.alliedmods.net/showthread.php?p=851160

Lolz0r 09-03-2013 18:19

Re: Message
 
Can anybody tell me whether this plugin is good ?


All times are GMT -4. The time now is 17:14.

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