Forum

> > CS2D > Scripts > our lua have error
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch our lua have error

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt our lua have error

maninja
User Off Offline

Zitieren
hello Guys

I was working on this Lua And I wanted to Add Save steam When I wanted to try it, boom Lua Error and No work Please any Someone Help me ?

Okey That Fix its !!
1× editiert, zuletzt 24.01.19 16:29:48

alt Re: our lua have error

TrialAndError
User Off Offline

Zitieren
Some if's are missing an end.

Spoiler >

alt Re: our lua have error

maninja
User Off Offline

Zitieren
Thx You Very much


but have error

Ths is error
1
2
3
LUA ERROR: sys/lua/autorun/lvl_exp.lua:65: attempt to compare string with boolean
 -> sys/lua/autorun/lvl_exp.lua:65: in function <sys/lua/autorun/lvl_exp.lua:60>
 -> in Lua hook 'leave', params: 7, 0
2× editiert, zuletzt 24.01.19 16:30:16

alt Re: our lua have error

Quattro
GAME BANNED Off Offline

Zitieren
(player(id,"steam")>"0")


Can you even compare strings like that? First check what is an empty value of steamid then make it

if player(id,"steam") <> that value then...


...or change steamid to number but from my experience you will run into some problems. That is why I used this in my huge script and even changed all usgns to string:

edit, found it for you in my script:
1
2
elseif steam == '0' or steam == nil or steam == 0 or steam == '' then
            return 0

alt Re: our lua have error

SQ
Moderator Off Offline

Zitieren
@user Hajt: This is the only correct way of doing it. "
1
player(id,"steam")~="0"

@user Hajt: Lua does not support long integers, this is the reason we are using strings for this. Lua will convert to 32 float and will be corrupted, wont work as expected.

String method is way more reliable approach to pass steam id's, steam do the same with their API.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht