Thread Rating:
  • 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
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-Cdeveloper. Neko engine wip
Steam: Click
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
Reply

#5
Thanks man, much appreciated
Reply



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

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.