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

Help with stock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 08-09-2012 , 23:12   Help with stock
Reply With Quote #1

Hi all.

This is my code:

Code:
stock print_msg(id, message[], any:...) {     client_print(id, print_chat, "%s %s", prefix, message);         if(id == 0)         server_print("%s %s", prefix, message);             return PLUGIN_HANDLED; }

My problem is: When I put a variable, example:
Code:
print_msg(id, "Your name is: %s", szName);
, only shows Your name is:

Sorry for my bad english!

Thanks.
__________________
kramesa is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-09-2012 , 23:13   Re: Help with stock
Reply With Quote #2

vformat
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-09-2012 , 23:15   Re: Help with stock
Reply With Quote #3

You need to actually read the paramaters sent in to the any... arguments.
numargs is where you should be looking.
Also read some stock and third party includes that use that functionality as examples. Connor's ColorChat include is a good one.

EDIT: Use that in conjunction with YamiKaitou's post as well. But mostly his.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 08-09-2012 at 23:16.
Liverwiz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-10-2012 , 02:13   Re: Help with stock
Reply With Quote #4

numargs is not needed at all, use only vformat.

If the problem is only with index == 0, and if you want to print in console, use console_print, with index == 0 it doesn't loop through players but prints in server console.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 16:19.


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