mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-18 03:53:26 +02:00
Converted tfs 1.0 scripts to meta, removed some spaces from config and fixed a typo
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
-- <talkaction words="!report" separator=" " script="adminreport.lua"/>
|
||||
-- Coded by Dark ShaoOz, modified by Znote
|
||||
function onSay(cid, words, param, channel)
|
||||
local storage = 6708 -- (You can change the storage if its already in use)
|
||||
local delaytime = 30 -- (Exhaust In Seconds.)
|
||||
local x = getPlayerPosition(cid).x -- (Do not edit this.)
|
||||
local y = getPlayerPosition(cid).y -- (Do not edit this.)
|
||||
local z = getPlayerPosition(cid).z -- (Do not edit this.)
|
||||
if(param == '') then
|
||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command param required.")
|
||||
local player = Player(cid)
|
||||
local storage = 6708 -- You can change the storage if its already in use
|
||||
local delaytime = 30 -- Exhaust In Seconds.
|
||||
if param == '' then
|
||||
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Command param required.")
|
||||
return true
|
||||
end
|
||||
if (getPlayerStorageValue(cid, storage) <= os.time()) then
|
||||
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
|
||||
db.query("INSERT INTO `znote_player_reports` (`id` ,`name` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`)VALUES (NULL , '" .. getPlayerName(cid) .. "', '" .. x .. "', '" .. y .. "', '" .. z .. "', " .. db.escapeString(param) .. ", '" .. os.time() .. "')")
|
||||
setPlayerStorageValue(cid,storage,os.time()+delaytime)
|
||||
if player:getStorageValue(storage) <= os.time() then
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "Your report has been received successfully!")
|
||||
db.query("INSERT INTO `znote_player_reports` (`id` ,`name` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`)VALUES (NULL , '" .. player:getName() .. "', '" .. player:getPosition().x .. "', '" .. player:getPosition().y .. "', '" .. player:getPosition().z .. "', " .. db.escapeString(param) .. ", '" .. os.time() .. "')")
|
||||
player:setStorageValue(storage, os.time() + delaytime)
|
||||
else
|
||||
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have to wait "..getPlayerStorageValue(cid, storage) - os.time().." seconds to report again.")
|
||||
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You have to wait " .. player:getStorageValue(storage) - os.time() .. " seconds to report again.")
|
||||
end
|
||||
return TRUE
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
Reference in New Issue
Block a user