our lua have error
8 replies



24.01.19 10:00:13 am
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 !!
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
Thx You Very much
but have error
Ths is error


but have error
Ths is error
Code:
1
2
3
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
-> 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
(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:
Code:
1
2
2
elseif steam == '0' or steam == nil or steam == 0 or steam == '' then
return 0
return 0
Best match: https://www.youtube.com/watch?v=je2Q2XR2Zys
Best match: https://www.youtube.com/watch?v=je2Q2XR2Zys
@
Hajt: This is the only correct way of doing it. "
@
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.

Code:
1
player(id,"steam")~="0"
@

String method is way more reliable approach to pass steam id's, steam do the same with their API.



