So here is a script right here which loads usgn ID to save progress (level and exp) and when i replace "usgn" with "steamid" the script fails to work.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function cod_team_load(id) if cod_1_set[id]==1 then cod_1_set[id] = 0 if (player(id,"usgn") > 0) then cod_msg2(id,3,'Logged in with: '..player(id,"usgn")..'@C') local usgn = player(id, "usgn") open = io.open('sys/lua/codsaves/'..player(id,"usgn")..'.txt','r') if (open ~= nil) then cod_msg2(id,2,'Your Files found!@C') for line in io.lines('sys/lua/codsaves/'..player(id,"usgn")..'.txt','r') do local parses = totable(line) if (tonumber(parses[1]) > 0) then cod_xp[id] = tonumber(parses[1]) start_check_lvl(id) open:close() end end else cod_msg2(id,4,'No Files found!@C') cod_xp[id] = 0 end else cod_txt2(id,5,4,'No Unreal Software account!',3,415,0) end if cod_xp[id] == 0 or (player(id,"usgn") < 1) then cod_xp[id] = 0 cod_nxp[id] = 100 cod_lvl[id] = 1 end
When I start my server it gives the following error. That I am comparing a number to a string. Sorry I am new to scripting, last time I scripted was 5 years ago and I wasnt good anyways.
1
2
3
4
2
3
4
[01:44:17] LUA ERROR: sys/lua/cod_gamemode.lua:2423: attempt to compare number with string [01:44:17] -> sys/lua/cod_gamemode.lua:2423: in function 'cod_team_load' [01:44:17] -> sys/lua/cod_gamemode.lua:717: in function <sys/lua/cod_gamemode.lua:694> [01:44:17] -> in Lua hook 'team', params: 1, 1, 1