Raised This Month: $ Target: $400
 0% 

Clear Chat Text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-26-2010 , 15:56   Clear Chat Text
Reply With Quote #1

How would i clear the chat text. I want to clear every message from chat at round start.
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-26-2010 , 16:04   Re: Clear Chat Text
Reply With Quote #2

You could send a SayText message with 5 blank lines "^n^n^n^n".
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-26-2010 , 16:05   Re: Clear Chat Text
Reply With Quote #3

ok ty.
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-26-2010 , 16:16   Re: Clear Chat Text
Reply With Quote #4

PHP Code:
    static szMsg[128];
    
formatex(szMsgsizeof(szMsg) - 1"^n^n^n^n");
    
    new 
iPlayers[MAX_PLAYERS], iNumplayer;
    
get_players(iPlayersiNum"a");
    
    for(new 
i<= iNumi++)
    {
        
player iPlayers[i];
        
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _player);
        
write_byte(0);
        
write_string(szMsg);
        
message_end();
    } 
something like that?
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-26-2010 , 18:19   Re: Clear Chat Text
Reply With Quote #5

1. Why format the variable when you know it's contents? Either make it constant or use copy() because there is no formatting.
2. Cache get_user_msgid("SayText") in plugin_init().
3. Don't loop through all players. Just use MSG_BROADCAST.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-26-2010 , 19:33   Re: Clear Chat Text
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
1. Why format the variable when you know it's contents? Either make it constant or use copy() because there is no formatting.
2. Cache get_user_msgid("SayText") in plugin_init().
3. Don't loop through all players. Just use MSG_BROADCAST.
PHP Code:
#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>

// Define the Plugin Version
new const VERSION[] = "1.0";

new const 
szMsg2[] = "^n^n^n^n";

new 
g_msgClear;

public 
plugin_init()
{
    
register_plugin("Clear MSG Test"VERSION"Shuttle_Wave");

    
register_logevent("EventRoundStart",    2,    "1=Round_Start");
    
    
g_msgClear get_user_msgid("SayText");
}

public 
EventRoundStart()
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgClear_MSG_BROADCAST);
    
write_byte(0);
    
write_string(szMsg2);
    
message_end();

????
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-26-2010 , 19:52   Re: Clear Chat Text
Reply With Quote #7

PHP Code:
#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>

// Define the Plugin Version
new const VERSION[] = "1.0";

new 
g_msgSayText;

public 
plugin_init()
{
    
register_plugin("Clear MSG Test"VERSION"Shuttle_Wave");

    
register_logevent("EventRoundStart",    2,    "1=Round_Start");
    
    
g_msgSayText get_user_msgid("SayText");
}

public 
EventRoundStart()
{
    
message_begin(MSG_BROADCASTg_msgSayText);
    
write_byte(0);
    
write_string("^n^n^n^n");
    
message_end();

Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 11-26-2010 , 20:04   Re: Clear Chat Text
Reply With Quote #8

Quote:
Originally Posted by Emp` View Post
PHP Code:
#pragma semicolon 1

#include <amxmodx>
#include <amxmisc>

// Define the Plugin Version
new const VERSION[] = "1.0";

new 
g_msgSayText;

public 
plugin_init()
{
    
register_plugin("Clear MSG Test"VERSION"Shuttle_Wave");

    
register_logevent("EventRoundStart",    2,    "1=Round_Start");
    
    
g_msgSayText get_user_msgid("SayText");
}

public 
EventRoundStart()
{
    
message_begin(MSG_BROADCASTg_msgSayText);
    
write_byte(0);
    
write_string("^n^n^n^n");
    
message_end();

doesnt seem to work ( clear msg from chat )
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 11-27-2010 , 02:11   Re: Clear Chat Text
Reply With Quote #9

Try to change
PHP Code:
write_string("^n^n^n^n"); 


to
PHP Code:
write_string("|"); 
dFF is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-27-2010 , 04:45   Re: Clear Chat Text
Reply With Quote #10

You need to provide a valid sender ID. Search for a connected player.
__________________
hleV 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 11:14.


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