Forum

> > CS2D > Scripts > our lua have error
Forums overviewCS2D overview Scripts overviewLog in to reply

English our lua have error

8 replies
To the start Previous 1 Next To the start

old our lua have error

maninja
User Off Offline

Quote
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 !!
edited 1×, last 24.01.19 04:29:48 pm

old Re: our lua have error

TrialAndError
User Off Offline

Quote
Some if's are missing an end.

Spoiler >

old Re: our lua have error

maninja
User Off Offline

Quote
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
edited 2×, last 24.01.19 04:30:16 pm

old Re: our lua have error

Quattro
GAME BANNED Off Offline

Quote
(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

old Re: our lua have error

SQ
Moderator Off Offline

Quote
@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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview