• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Broadcast Quest Service

Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
188
Location
Venezuela
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

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.
 
Can t = string.explode(param, ",") really have more values than t[1] and t[2]? I think you need to separate t[2].. ;O

Have you tested it?
 
is there the possibility of using this script like this:
you can broadcast if you have in your backpack the item of id 1000, for example?
like, instead money, the script checks if you have the item and then broadcast it for you
 
Back
Top