Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: [COD2] Random string hud

  1. #11
    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
    0 char
    timescale 0.01

  2. #12
    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
    Ok, rekted the 10 char test now, minimum is 1 char and quote strings are counted.

    Moczulak: you need to install libcod
    timescale 0.01

  3. #13
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by voron00 View Post
    Alright, if you use libcod you can use use new makelocalizedstring function:
    PHP Code:
    // Find free localized string index
    index findFreeConfigStringIndex(1310256);

    // Set configstring
    setConfigString(indexlevel.mapcandidate[0]["mapname"]);

    // Your Hud Stuff
    level.votemap0 setText(makeLocalizedString(level.mapcandidate[0]["mapname"]));

    findFreeConfigStringIndex(startend)
    {
        for (
    start 1start endi++)
        {
            
    configstring getConfigString(i);
            if (!
    isDefined(configstring))
                return 
    i;
        }

        return 
    undefined;

    Just tested it, works quite nicely.

    Or you can use the old fashioned way and replace strings on a client (iznogod's settext wrapper)
    Dont forget to check if index is a proper index. Might be undefined if the configstrings are all used up.

    Default cod configstring functions can take care of this for you, including a "is it already duplicated somewhere else" check.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Posting Permissions

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