Raised This Month: $ Target: $400
 0% 

Newbie Question - Could use help though


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
I3lade203
Junior Member
Join Date: Jun 2007
Old 09-20-2007 , 01:36   Newbie Question - Could use help though
Reply With Quote #1

Hi, this is probably going to sound like an incredibly simple question, mainly because it is one... but i'm still trying to learn my way around everything, so i'd appreciate the help.

Basiclly, what I want to know is how do I print a variable within a string? For example, I want to do something like this:

Code:
show_hudmessage(0, "Class Wars - [Duel Mode] : Attacking" blueclass1 " VS Defending " redclass1 "!" , g_displayMsg)
Where blue and red inbetween the quotation marks are variables that I want printed, so it can show numbers that change but keep the rest of the text static. How would I do this? I know in java I would do "Text" +variable+ "Text" but i'm uncertain of how it works with pawn. Once again, I really appreciate the help. Thanks in advance!

Last edited by I3lade203; 09-20-2007 at 09:57.
I3lade203 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-20-2007 , 02:03   Re: Newbie Question - Could use help though
Reply With Quote #2

Something like. Basicaly, you have to use '%s'.

mystring1 = "blueclass1";
mystring2 = "redclass1";

show_hudmessage(0, "Class Wars - [Duel Mode] : Attacking %s VS Defending %s!" , mystring1, mystring2 );
__________________
Arkshine is offline
I3lade203
Junior Member
Join Date: Jun 2007
Old 09-20-2007 , 10:24   Re: Newbie Question - Could use help though
Reply With Quote #3

Thanks! Really helped a lot. +Karma.
I3lade203 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:14.


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