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

Need Talkaction for player send msg for host!

ninexin

insane.sytes.net
Joined
Jun 10, 2007
Messages
213
Reaction score
3
Location
Brazil
Hi otland, i need one talkaction for player send a msg for hoster!!!

Ex: !votedtop5 nameCHAR, Hrs

and a log is created on the host with the data. but the command can be used once per hour.
 
Code:
local storage = 12000

function onSay(cid, words, param, channel)
	if(param ~= '') then
		if not exhaustion.get(cid, storage) then
			doWriteLogFile('./data/logs/messages-for-hoster/'.. getCreatureName(cid) ..'.txt', param)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have sent message to a hoster.')
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have to wait '.. exhaustion.get(cid, storage) ..' seconds in order to use this command again.')
		end
	end
	return true
end

@Edited:
Forgot to add storage variable, thanks to JDB for his 'report' :p.
 
Last edited:
hi broo thxxx for help but here the exaust not work
end not have errors in console, how i fix this??

thx
 
Last edited:
exhaustion.set ? :p

LUA:
local storage = 12000

function onSay(cid, words, param, channel)
	if(param ~= '') then
		if not exhaustion.get(cid, storage) then
			exhaustion.set(cid, storage, 3600)
			doWriteLogFile('./data/logs/messages-for-hoster/'.. getCreatureName(cid) ..'.txt', param)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have sent message to a hoster.')
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have to wait '.. exhaustion.get(cid, storage) ..' seconds in order to use this command again.')
		end
	end
	return true
end
 
Back
Top