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

Solved [H3LP] What's Wrong


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-20-2017 , 16:32   [H3LP] What's Wrong
Reply With Quote #1

So here's my stock. Basically I want to print a message to all connected players, excluding myself but it's not working fine. Any ideas why? The IsUserConnected stock is correctly defined, it checks first if the client is in game and then connected. Thanks !

Code:
stock PrintToChatExcludeClient(int client, const char[] message, any:...) {     for(int i = 1; i < MaxClients; i++)     {         if(IsUserConnected(i) && i !=client)             PrintToChat(i, "%s", message);     } }

Last edited by DarthMan; 11-21-2017 at 01:55. Reason: Solved
DarthMan is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-20-2017 , 16:38   Re: [H3LP] What's Wrong
Reply With Quote #2

Here is the VFormat example from the Wiki.

Code:
public void formatExample(const char[] myString, any ...)
{
	int len = strlen(myString) + 255;
	char[] myFormattedString = new char[len];
	VFormat(myFormattedString, len, myString, 2);
 
	PrintToServer(myFormattedString);
}
__________________
Neuro Toxin is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-20-2017 , 17:03   Re: [H3LP] What's Wrong
Reply With Quote #3

Quote:
Originally Posted by Neuro Toxin View Post
Here is the VFormat example from the Wiki.

Code:
public void formatExample(const char[] myString, any ...)
{
	int len = strlen(myString) + 255;
	char[] myFormattedString = new char[len];
	VFormat(myFormattedString, len, myString, 2);
 
	PrintToServer(myFormattedString);
}
Thanks, will have a look
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-21-2017 , 01:55   Re: [H3LP] What's Wrong
Reply With Quote #4

Quote:
Originally Posted by Neuro Toxin View Post
Here is the VFormat example from the Wiki.

Code:
public void formatExample(const char[] myString, any ...)
{
	int len = strlen(myString) + 255;
	char[] myFormattedString = new char[len];
	VFormat(myFormattedString, len, myString, 2);
 
	PrintToServer(myFormattedString);
}
Many thanks !
DarthMan 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 17:28.


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