With this script, players will be able to buy an amulet of loss automatically when they die just using the comand /aol on, /aol off
¿Does this system is really usefull?
Yes!, you don't lose your time going to shop tu buy aol, you go directly to the war!
CreatureScripts
TalkActions
Enjoy eace:
¿Does this system is really usefull?
Yes!, you don't lose your time going to shop tu buy aol, you go directly to the war!
CreatureScripts
PHP:
<event type="login" name="AolBuyer" event="script" value="aolbuyer.lua"/>
Lua:
local config = {
storage = 3500,
price = 10000;
};
function onLogin(cid)
if getPlayerStorageValue(cid, (config.storage)) == 0 then
return TRUE
end
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173 then
return TRUE
end
if getPlayerMoney(cid) < (config.price) then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"WARNING: You do not have enough money to buy an amulet of loss.")
return TRUE
end
doPlayerRemoveMoney(cid, (config.price))
doPlayerAddItem(cid,2173,1)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have bought an amulet of loss automatically.")
return TRUE
end
TalkActions
PHP:
<talkaction words="/aol" hide="yes" event="script" value="aol.lua"/>
Lua:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
if(param == 'on') then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have turned ON the Aol Buyer.")
doPlayerSetStorageValue(cid, 3500, 1)
return true
end
if(param == 'off') then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have turned OFF the Aol Buyer.")
doPlayerSetStorageValue(cid, 3500, 0)
return true
end
return true
end
Enjoy eace:
Last edited: