Raised This Month: $ Target: $400
 0% 

alternate quotation marks for es_format


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-29-2005 , 21:38   alternate quotation marks for es_format
Reply With Quote #1

Mattie: ATM its not possible to use es_format within an alias because the " "'s throw off the alias'ing. Would it be possible to be able to use another char to mark the beginning and end of the string?
__________________
ichthys is offline
Cr3V3TT3
Senior Member
Join Date: Jul 2004
Location: V'dauban
Old 05-30-2005 , 08:57  
Reply With Quote #2

dont put "" for the alias will resolve this maybe
Code:
alias myformat es_format myvar "this is a %1" server_var(myvar2);
Cr3V3TT3 is offline
Send a message via MSN to Cr3V3TT3
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-30-2005 , 10:36   Re: alternate quotation marks for es_format
Reply With Quote #3

Quote:
Originally Posted by ichthys
Mattie: ATM its not possible to use es_format within an alias because the " "'s throw off the alias'ing. Would it be possible to be able to use another char to mark the beginning and end of the string?
Sorry-- I don't think there's going to be an easy way to do this. I do it by using a variable for the format string like this:
Code:
// EventScripts v0.7.7
es_setinfo formatstring "Gravity is %1"
es_setinfo var 0
alias myformat es_format var server_var(formatstring) server_var(sv_gravity)
This still isn't going to be the best workaround for all situations. Still, this would be the sole exception to me going using Valve's automatic token parser. I really would like to keep the format string as a single token and quotes are the only way to be certain of that.

-Mattie
Mattie is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 05-30-2005 , 12:31  
Reply With Quote #4

Well i've got it to work for now. But only when the es_Format string has no spaces. I want it for a line of commands not just one es_Format.
I've dont it like this.

alias sub1 es_format user "%1" server_var(user)
alias alias "sub1; es_tell server_var(user) asdfasdfasdf"

When i checked my alias's there are no quotes around %1.
__________________
ichthys is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 05-30-2005 , 15:07  
Reply With Quote #5

Quote:
Originally Posted by ichthys
Well i've got it to work for now. But only when the es_Format string has no spaces. I want it for a line of commands not just one es_Format.
I've dont it like this.

alias sub1 es_format user "%1" server_var(user)
alias alias "sub1; es_tell server_var(user) asdfasdfasdf"

When i checked my alias's there are no quotes around %1.
Yeah, it needs to be a single 'token', and if there's no spaces it will be treated as such. To create a single token with a string with spaces, you have to have quotes.

-Mattie
Mattie 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 01:57.


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