Raised This Month: $51 Target: $400
 12% 

[USEFUL STOCK] ChatMessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sumguy14
Senior Member
Join Date: Apr 2006
Old 06-05-2007 , 00:20   [USEFUL STOCK] ChatMessage
Reply With Quote #1

This is basically just PrintToChat but you can give it 0 as a client index which messages to all players. I am new to SourceMod so go easy, it may not be the best quality.

Example:

Code:
ChatMessage(0,"This is a message to the whole server");
Code:

Code:
stock ChatMessage(target,const String:message[],any:...)
{
  decl String:buffer[192];
  VFormat(buffer,191,message,3);
  if(target)
    PrintToChat(target,"%s",buffer);
  else
  {
    new maxplayers=GetMaxClients()
    for(new index=1;index<=maxplayers;index++)
    {
      if(IsClientConnected(index))
        PrintToChat(index,"%s",buffer);
    }
  }
}

Last edited by sumguy14; 06-05-2007 at 00:29.
sumguy14 is offline
Reply



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 04:58.


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