Keraxel
Ω Obfuscator Ω
Hi Otlanders,
Is Anyone got an idea how to overwrite global variable in lua? I try to add Player's cid to function this way, that I'll be able to read it from other function.
It looks like that:
lua table:
function in data/lib:
globalevent printing size of table each second:
I'll hope someone knows the solution.
Regards,
Keraxel.
Is Anyone got an idea how to overwrite global variable in lua? I try to add Player's cid to function this way, that I'll be able to read it from other function.
It looks like that:
lua table:
Lua:
ctf = {flaggers = {}}
function in data/lib:
Lua:
...
print(table.insert(ctf.flaggers, cid))
print(#ctf.flaggers) -- prints 1
...
globalevent printing size of table each second:
Lua:
<globalevent name="markCtfFlagger" interval="1" event="script"><![CDATA[
function onThink(interval, lastExecution)
return print(#ctf.flaggers) --always prints 0
]]></globalevent>
I'll hope someone knows the solution.
Regards,
Keraxel.