• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Strange and unknow bug in a script!

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
Hello.

I tested a script that player says !report blablabla and the things he write appear on a txt inside data folder.
I tested in my windows computer and all went good. All work good!

Code:
function onSay(cid, words, param, channel)
local storage = 6967
local delaytime = 120
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Paramters missing")
return true
end
local exhaust = exhaustion.get(cid, storage)
if(not exhaust) then
exhaustion.set(cid, storage, delaytime)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "thanks for report!!")
f:write(""..getPlayerName(cid).." reportou um bug em " .. os.date("%d %B %Y - %X.", os.time()) .."\n"..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
f:close()
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "U must wait " .. exhaustion.get(cid, storage) .. " seconds to report again.")
end
return TRUE
end

But when i putted this code to my linux, all work good but DELAY are not working. What can i do? Maybe windows are reading 'local delaytime = 120' in seconds and linux are reading maybe in miliseconds?

Help!
 
Back
Top