Forum

> > CS2D > Scripts > Error with values
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Error with values

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Error with values

loadkinger
User Off Offline

Zitieren
Hello,

I Need help with any values.

See my script

1
2
3
...
print(k)
...


Output
1
2
3
4
5
6
7
8
9
10
5
5
5
5
5
5
5
5
5
5

then

1
2
3
if k:find("5\n 5\n 5\n") then
msg("It works")
end

Is not working, the msg is not showing, why?

alt Re: Error with values

loadkinger
User Off Offline

Zitieren
user Starkkz hat geschrieben
You misunderstood me.
1
2
3
if k:find("5\n5\n5\n") then
msg("It works")
end


Output :

1
5

-----------


user loadkinger hat geschrieben
1
2
3
4
5
6
7
8
9
10
5
5
5
5
5
5
5
5
5
5


I Need read somy letters in with find.
The problem is : He is getting new line
Ex :
5
5
5
5
5
5

alt Re: Error with values

EngiN33R
Moderator Off Offline

Zitieren
I haven't a bloody clue as to what you want.

user loadkinger hat geschrieben
See my script

1
2
3
...
print(k)
...

This is not your script, this is one insignificant line that hardly helps to understand your issue.

CS2D's print function is a bit weird and doesn't support new lines all that well. If you're getting a steady stream of fives, each on a new line, then it means that print is being called multiple times, which implies a recursion or loop of some sort. If that is the case, then every k is actually just a '5' and doesn't contain any newline characters. Therefore, finding '5\n5\n5' will fail.

user loadkinger hat geschrieben
I Need read somy letters in with find.
The problem is : He is getting new line
Ex :
5
5
5
5
5
5

This makes even less sense that everything you have said up to this point combined. I'm sorry, but you're going to have to explain yourself better.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht