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

Help with printing out strings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AwesomeMan
Member
Join Date: Jun 2013
Old 06-18-2013 , 06:47   Help with printing out strings
Reply With Quote #1

Hey,
I have a problem for plugin I am creating. It's basically like amx_vote but with 7 choices. I'm new to pawn and I was wondering how can I client_print a variable? I have created new g_Arg1 and made it read_argv(1, g_Arg1, 32). It works fine in the vote menu, it does appear. But, I'm having trouble with printing it in chat.
I tried few methods, such as:
client_print(id, print_chat, "You have selected Option 1: %s" g_Arg1);
and some others based on same thing. I have tried googling, spend hours trying to figure out but got nothing. Any help appreciated.
AwesomeMan is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 06-18-2013 , 09:32   Re: Help with printing out strings
Reply With Quote #2

It seems right. Post the full code

Last edited by akcaliberg; 06-18-2013 at 09:32.
akcaliberg is offline
AwesomeMan
Member
Join Date: Jun 2013
Old 06-18-2013 , 10:33   Re: Help with printing out strings
Reply With Quote #3

I have figured it out. I have created new variable for each one. I made it static and it worked. It's in different function if that matters. Also, the g_Arg* is used in menu, if that does something.

So I have 2 variables for each arguement and for now works fine.

Don't want to post the code, will probably be laughed at. It's like amx_vote but with 7 choices yet it has 300 lines.
AwesomeMan is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 06-18-2013 , 14:13   Re: Help with printing out strings
Reply With Quote #4

I don't understand what you have done. Be sure that the variable is string. And no one will laugh at your code. This section is for helping. Remember that no one began to scripting as a professional. If you post your code, we can advise you to simple tips
akcaliberg is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2013 , 00:14   Re: Help with printing out strings
Reply With Quote #5

Quote:
Originally Posted by AwesomeMan View Post
I have figured it out. I have created new variable for each one. I made it static and it worked. It's in different function if that matters. Also, the g_Arg* is used in menu, if that does something.

So I have 2 variables for each arguement and for now works fine.

Don't want to post the code, will probably be laughed at. It's like amx_vote but with 7 choices yet it has 300 lines.
Based on this post, it sounds like there are likely things you can do to make it better/more efficient. As akcaliberg said, this is a place for learning and you should not hesitate to post your code.

As long as you have tried to figure it out the issue on your own (it sounds like you have) we will have much more respect for you. There will always be someone who will be harsh (I've been known to do this sometimes but I mean no disrespect) but just take it in stride and be patient.
__________________
fysiks 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 05:08.


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