Hello, this one is a script that I did some days ago and a friend said to me that it should put it here .. this way that here this one
talakctions.xml:
How use?
Code:
function onSay(cid, words, param)
local cost = 5000
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
return TRUE
end
local t = string.explode(param, ",")
local name = t[1]
local price = tonumber(t[2])
local hours = tonumber(t[3])
local minutes = tonumber(t[4])
if(not name) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No quest name specified.")
return TRUE
end
if(not price) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No price specified.")
return TRUE
end
if(not hours) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No hours specified.")
return TRUE
end
if(not minutes) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No minutes specified.")
return TRUE
end
price = math.abs(price)
hours = math.abs(hours)
minutes = math.abs(minutes)
if doPlayerRemoveMoney(cid, cost) == TRUE then
doBroadcastMessage(cid, "" .. getCreatureName(cid) .. "[" .. getPlayerLevel(cid) .. "]: Service of " .. name .. " quest. Price: " .. price .. " gold. Quest start in " .. hours .. " hours and " .. minutes .. " minutes.", MESSAGE_STATUS_CONSOLE_RED)
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need " .. cost .. " gold pieces.")
return TRUE
end
end
talakctions.xml:
Code:
<talkaction log="yes" words="!broadcast" script="script_name.lua" />
How use?
Code:
!broadcast Inquisition, 150000, 1, 45
20:01 Darkhaos[115]: Service of Inquisition Quest. Price: 150000 gold. Quest start in 1 hours and 45 minutes.