• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
whats the command to get string length
#1
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
  Reply
#2
text.size

Just add the .size behind the variable name and thats the string length Smile
[Image: veovuq.png]
  Reply
#3
(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.
C++/Obj-C developer. Neko engine wip
Steam: Click
[-] The following 1 user says Thank You to Nekochan for this post:
  • pedjas
  Reply
#4
(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
[Image: veovuq.png]
[-] The following 2 users say Thank You to Yamato for this post:
  • Nekochan, pedjas
  Reply
#5
Thanks man, much appreciated
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help Getting string from perk? DidUknowiPwn 3 1,353 09-27-2013, 19:10
Last Post: Nekochan
  Help auto command Dynasty 6 1,540 08-26-2013, 16:05
Last Post: hillbilly
  [HELP]Adding Spaces in a String dhanin 1 652 03-30-2013, 16:09
Last Post: Nukem
  !come command Dr3am95 12 2,225 02-12-2013, 12:08
Last Post: SgtLegend
  [Request] Team change by admin command. Dumas 10 4,235 11-29-2012, 21:38
Last Post: 99IRock
Question Help kick command still need help koro35 3 1,136 11-27-2012, 22:45
Last Post: koro35
Question Help ERROR STRING koro35 3 1,132 11-20-2012, 15:51
Last Post: JariZ
  [Help] How to hide a command? korsika 4 1,610 10-27-2012, 23:30
Last Post: korsika
  Help C# Tutorial on how to reset a string DidUknowiPwn 7 2,261 10-11-2012, 15:04
Last Post: DidUknowiPwn
  server command problem anedaktos 3 1,160 08-05-2012, 12:14
Last Post: hillbilly

Forum Jump:


Users browsing this thread: 1 Guest(s)