ItsMods

Full Version: whats the command to get string length
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want length(string) but this thing always returns true, whats the command for mw2 ?
Code:
Length( <vector> )
Module: Vector

Summary:

Returns the length of the given vector


Example:

dist = Length( models[j].origin - center );



Required Args:

    1 : <vector> A vector

i tried this also
Code:
        counter= 0;
        foreach( char in MyString )
        {
        counter += 1;
        }
but counter is always 0
text.size

Just add the .size behind the variable name and thats the string length Smile
(01-20-2013, 14:18)Yamato Wrote: [ -> ]text.size

Just add the .size behind the variable name and thats the string length Smile

Size is for arrays like level.players.size...
But maybe it will work.
(01-20-2013, 14:42)SailorMoon Wrote: [ -> ]
(01-20-2013, 14:18)Yamato Wrote: [ -> ]text.size

Just add the .size behind the variable name and thats the string length Smile

Size is for arrays like level.players.size...
But maybe it will work.

Its for strings too, a string is an array. I have used it for example here in fixstring function

http://www.itsmods.com/forum/Thread-Rele...ished.html
Thanks man, much appreciated