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

NPC or TALKACTION

Scurzo

New Member
Joined
Aug 23, 2008
Messages
66
Reaction score
0
I need an npc or talkaction to
*sell skills (complete skills like /addskill)
*to broadcast
for x items (money)
Im using Mystic Spirit

I also need a lvl door for lvls 1000+

Thanks For Your Time
 
Last edited:
Hey man, I did only the talkaction for broadcasting the items... Maybe I do the others and post here, but now I'm very busy. Here you go:

Put it in your data/talkactions/scripts:
sell.lua
PHP:
function onSay(cid, words, param)
local config = {
               levelNeeded = 8,
               muteTime = 120, -- time in Seconds that the player will be without broadcasting.
               storage = 7896 -- storage that controls the broadcasting of the player.
               }
if param == '' then
doPlayerPopupFYI(cid, "Say '!sell Item Name, Price in GP'")
end

t = string.explode(param, ",")
if not(t[1]) or not(t[2]) then
doPlayerSendCancel(cid, "Command requires more than one parameter.")
else

if getPlayerLevel(cid) >= config.levelNeeded then

   if getPlayerStorageValue(cid,config.storage) == -1 then
   setPlayerStorageValue(cid, config.storage, os.time())

   elseif getPlayerStorageValue(cid,config.storage) > os.time() then
   doPlayerSendCancel(cid, "You can only place one offer in " .. config.muteTime .. " seconds.")
   
   elseif getPlayerStorageValue(cid,config.storage) <= os.time() then
   doBroadcastMessage("Player " .. getPlayerName(cid) .. " is selling " .. t[1] .. " for " .. t[2] .. " gold coins.")
   setPlayerStorageValue(cid,config.storage, (os.time() + 120))
   end

else
doPlayerSendCancel(cid, "Only players with level " .. config.levelNeeded .. "+ can broadcast one offer.")
end
end

return true
end

buy.lua
PHP:
function onSay(cid, words, param)
local config = {
               levelNeeded = 8,
               muteTime = 120, -- time in Seconds that the player will be without broadcasting.
               storage = 7896 -- storage that controls the broadcasting of the player.
               }
if param == '' then
doPlayerPopupFYI(cid, "Say '!buy Item Name, Price in GP'")
end

t = string.explode(param, ",")
if not(t[1]) or not(t[2]) then
doPlayerSendCancel(cid, "Command requires more than one parameter.")
else

if getPlayerLevel(cid) >= config.levelNeeded then

   if getPlayerStorageValue(cid,config.storage) == -1 then
   setPlayerStorageValue(cid, config.storage, os.time())

   elseif getPlayerStorageValue(cid,config.storage) > os.time() then
   doPlayerSendCancel(cid, "You can only place one offer in " .. config.muteTime .. " seconds.")
   
   elseif getPlayerStorageValue(cid,config.storage) <= os.time() then
   doBroadcastMessage("Player " .. getPlayerName(cid) .. " is buying " .. t[1] .. " for " .. t[2] .. " gold coins.")
   setPlayerStorageValue(cid,config.storage, (os.time() + 120))
   end

else
doPlayerSendCancel(cid, "Only players with level " .. config.levelNeeded .. "+ can broadcast one offer.")
end
end

return true
end

Now put these tags in your talkactions.xml:
PHP:
<talkaction words="!buy" event="script" value="buy.lua"/>
<talkaction words="!sell" event="script" value="sell.lua"/>

To prevent players spamming, I did a system that you can only say anything every 2 minutes only. But now you control what your players are going to say. Explanations:
~~ !buy / !sell --> If you say only this, will appear a popup channel to the player, explaining what he must say.
~~ !buy Item Name, Price / !sell Item Name, Price --> Will send a broadcast message saying: "Player X is buying/selling Item Name for Price gold coins."

I'd put some screenshots, but my Net is a little bit slowy to up it. Intending to have helped... Cya!
 
Of course have to edit it. You have to change the config tlabe.

PHP:
levelNeeded = 8 -- This is the level you need to use the buy & sell system.
muteTime = 120 -- This is the time, in seconds, the player will be without talking in the system.
storage = 7896 -- It controls the muteTime.
 
Back
Top