Results 1 to 10 of 35

Thread: Quick questions thread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    How can I print a precached string?

    I have this on Callback_StartGameType()
    Code:
    	game["spawnprotection"] = &"^2Spawn protection ^1OFF^7";
    	precacheString(game["spawnprotection"]);
    And I'm trying to print it like this
    Code:
    self iprintln(game["spawnprotection"]);
    set logfile 2

  2. #2
    Private Lonsofore's Avatar
    Join Date
    Oct 2016
    Posts
    86
    Thanks
    82
    Thanked 38 Times in 25 Posts
    Quote Originally Posted by guiismiti View Post
    How can I print a precached string?
    In iprintln you can use only simple strings (like str="string").
    And as I know, strings with & (don't know a real name of this strings. somebody tell me, please) you can only precache and use for HUDs.

    So, you can:
    1. Make a simple string and use iprintln:
    Code:
    game["spawnprotection"] = "^2Spawn protection ^1OFF^7";
    self iprintln(game["spawnprotection"]);
    2. Make a HUD with your precached string:
    Code:
    game["spawnprotection"] = &"^2Spawn protection ^1OFF^7";
    precacheString(game["spawnprotection"]);
    self.hud = newClientHudElem(self);
    self.hud.x = x;
    self.hud.y = y;
    self.hud.label = game["spawnprotection"];

  3. The Following 2 Users Say Thank You to Lonsofore For This Useful Post:

    guiismiti (23rd March 2017),kung foo man (23rd March 2017)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Quote Originally Posted by Lonsofore View Post
    And as I know, strings with & (don't know a real name of this strings. somebody tell me, please) you can only precache and use for HUDs.
    You could refer to them as "configstring strings" or "precached strings" (sic) ^^

    guiismiti:

    Basically you need to track yourself which values your precached strings have. IzNoGoD compiled this post with basically all info's: https://killtube.org/showthread.php?...out-precaching
    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    guiismiti (23rd March 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •