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

client_print


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 11-22-2010 , 15:51   client_print
Reply With Quote #1

PHP Code:
msg(word[])
{
    
client_print(0print_chat,"[Network] %s",word);
    return 
PLUGIN_CONTINUE


PHP Code:
if (equali(players,"2"))
          {
              
client_print(0print_chat,"[Network] Team Alpha: %s ^n[Network] Team Beta %s"player[1], player[2]);
          }
          else if (
equali(players,"4"))
          {
              
client_print(0print_chat,"[Network] Team Alpha: %s - %s ^n[Network] Team Beta %s - %s"player[1], player[2], player[3], player[4]);
          } 
Well i want the message function to can get all the values in the format

PHP Code:
msg("Team Alpha: %s - %s ^n[Network] Team Beta %s - %s",value1,value2,value3,value4); 
And generaly all the values that i will set, is it possible?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-22-2010 , 16:18   Re: client_print
Reply With Quote #2

Code:
msg(word[], any:...) {         new text[128];         vformat(text, charsmax(text), word, 2);           client_print(0, print_chat, "[Network] %s", text); }
__________________
hleV is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 11-22-2010 , 17:06   Re: client_print
Reply With Quote #3

just any?

any:...
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-22-2010 , 21:52   Re: client_print
Reply With Quote #4

Quote:
Originally Posted by ProIcons View Post
just any?

any:...
That means extra arguments are not limited to a specific tag.
If "..." was only put there, compiler wouldn't let Float (for example) to be passed.

Example:
Code:
#include < amxmodx > public plugin_init( ) {     new Float:flValue;     test( "%f", flValue ); } test( format[], ... ) {     new message[ 192 ]     vformat( message, 191, format, 2 )         server_print( "%s", message ) }
That would give a tag mismatch error.
Code:
#include < amxmodx > public plugin_init( ) {     new Float:flValue;     test( "%f", flValue ); } test( format[], {Float,_}:... ) {     new message[ 192 ]     vformat( message, 191, format, 2 )         server_print( "%s", message ) }
That allows Floats and untagged variables to be passed.
Code:
#include < amxmodx > public plugin_init( ) {     new Float:flValue;     test( "%f", flValue ); } test( format[], any:... ) {     new message[ 192 ]     vformat( message, 191, format, 2 )         server_print( "%s", message ) }
That allows variables of all tags to be passed.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 15:07.


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