• 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!

Saving in notepad

kapka

New Member
Joined
Aug 3, 2012
Messages
58
Reaction score
0
Hi, can someone tell me command which will save for e.x player msg while he will say !abc bla bla (it will save player name, time and msg) (need to script)
 
Thread has been moved, next time try to request in the requests board.
LUA:
function onSay(cid, words, param, channel)
local storage = 1234
local delaytime = 60
local a = "data/logs/text.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
local exhaust = exhaustion.get(cid, storage)
	if(not exhaust) then
		exhaustion.set(cid, storage, delaytime)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your message has been saved!")
		f:write("" .. os.date("%d %B %Y - %X.", os.time()) .."\n"..getPlayerName(cid).." said: "..param..".\n----------------------------------------------------------\n")
		f:close()
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. exhaustion.get(cid, storage) .. " seconds to save a message.")
	end
return TRUE
end
 
Back
Top