timiodimio
New Member
- Joined
- May 6, 2009
- Messages
- 16
- Reaction score
- 0
Easy to configure script to buy items with an !talkaction.
This one in talkactions/scripts
Put this in talkactions.xml:
Ciao!
This one in talkactions/scripts
PHP:
local itemid = 5710 <!-- light shovel -->
local count = 1
local succestalk = "You\'ve bought an light shovel."
local fail = "You don't have enough money."
function onSay (cid, words, param)
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, itemid, count)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, succestalk)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
else doPlayerSendCancel(cid, MESSAGE_EVENT_ADVANCE,talkcap)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
Put this in talkactions.xml:
HTML:
<talkaction words="!shovel" event="script" value="file.lua"/>
Ciao!