PDA

View Full Version : localized strings (help)



pollo
2nd May 2016, 20:27
hey guys.

Lately I've been working on a mod (kinda 'classic' one, not zombies), and I've been stuck with localized strings.

The thing is, I want the mod to be for spanish & english people, and when I was doing a script (a killstreak one) I wanted to use a localized string with multiple 'variables' (&&1, &&2... idk how to call those ^^). The thing is, when I use this:


iprintln(game["blabla"], self.name, attacker.name, self.pers["killstreak"])

with (it's not like this, I just put directly the string the variable refers to. Everything is precached and that),


game["blabla"] = "&&1 stopped &&2 's killing spree of &&3 kills!";

the game prints the information of self.name, attacker.name and self.pers["killstreak"] altogether where this thing, &&1, is. Like this:

Let's guess self.name = Pollo1; attacker.name = Pollo2; killstreak = 3


Pollo1Pollo23 stopped &&2 's killing spree of &&3 kills!

BUT the funny part is that when I replace &&2, &&3, &&4... with &&1, when I run the local server and join it, the game throws me an "Invalid game folder" error (wtf)

Do you guys know how can I print that info correctly? It may be a dumb question but, I've been hitting my head against the wall today for a long time. Any help is appreciated.

Ty

IzNoGoD
2nd May 2016, 21:16
https://killtube.org/showthread.php?2087-Tutorial-settext()-without-precaching

Or
just show a cvar in hud.menu, then setcvar it.