AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Mattie's Plugins (https://forums.alliedmods.net/forumdisplay.php?f=71)
-   -   alternate quotation marks for es_format (https://forums.alliedmods.net/showthread.php?t=38121)

ichthys 05-29-2005 21:38

alternate quotation marks for es_format
 
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?

Cr3V3TT3 05-30-2005 08:57

dont put "" for the alias will resolve this maybe
Code:

alias myformat es_format myvar "this is a %1" server_var(myvar2);

Mattie 05-30-2005 10:36

Re: alternate quotation marks for es_format
 
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

ichthys 05-30-2005 12:31

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.

Mattie 05-30-2005 15:07

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


All times are GMT -4. The time now is 04:16.

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