Forum

> > CS2D > Scripts > Lua "Q" : the string.sub
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua "Q" : the string.sub

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Lua "Q" : the string.sub

script favor
User Off Offline

Zitieren
Hello ,

I want to ask do the string.sub has mathematical behavior ?
e.g :
1
2
3
if string.sub(1,8+2-5)=="!kick" then

	etc.....

Actually didn't knew that.

alt Re: Lua "Q" : the string.sub

DC
Admin Off Offline

Zitieren
This is not related to that specific command at all. It's a general programming/scripting thing. You can do it everywhere.
Any parameter / value can either be a fixed value, a variable, a function call or a mathematical/logical expression (which can also contain other variables and function calls).

alt Re: Lua "Q" : the string.sub

Avo
User Off Offline

Zitieren
What user DC said. You can easily do stuff like that:
1
2
if string.sub(aString, 1, string.len(aString) - 1)=="!kick" then
 (...)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht