Ranyo13
ManCausingMayhem
- Joined
- Aug 22, 2009
- Messages
- 981
- Reaction score
- 39
Hello otlanders,
Im requesting a cool down system for bless command and aol command, here are my scripts i hope someone cud edit them so they have cool down of 60 seconds, and when a play tries to spam it he gets a message as a cancel message or red message in chat box that says "Cool down, (getsSecondsLeft) seconds left!" i want it to work even if the player buys any of them then die, i want it to work after the player dies also like cool down doesnt cancel if he buys aol then dies then buys aol again when he/she respawns.
Aol script:
Bless script:
If you edit them the cool down system, please highlight what you added coz im 100% sure that i will need the system in more commands later.
Please help me with that and i will realy appreciate it and i will add reputation to you (Rep++)
Thanks in advance,
Ranyo13
Im requesting a cool down system for bless command and aol command, here are my scripts i hope someone cud edit them so they have cool down of 60 seconds, and when a play tries to spam it he gets a message as a cancel message or red message in chat box that says "Cool down, (getsSecondsLeft) seconds left!" i want it to work even if the player buys any of them then die, i want it to work after the player dies also like cool down doesnt cancel if he buys aol then dies then buys aol again when he/she respawns.
Aol script:
PHP:
local buyableItems =
{
["aol"] = {money=10, id=2173, amount=1}
}
function onSay(cid, words, param)
local text = "Here's a list of all items that you can buy\nShop Item Name - Price - Item Name - Amount\n\n"
if(param == "" or param == nil) then
for k, v in pairs(buyableItems) do
text = text .. k .. " - " .. v.money .. " - " .. getItemNameById(v.id) .. " - " .. v.amount .. "\n"
end
return doShowTextDialog(cid, 1967, text)
else
buyItem = buyableItems[param]
if buyItem then
if getPlayerMoney(cid) >= buyItem.money then
doSendMagicEffect(getCreaturePosition(cid), 14)
doPlayerAddItem(cid, buyItem.id, buyItem.amount)
doPlayerRemoveMoney(cid, buyItem.money)
doPlayerSendTextMessage(cid, 24, "You've succesfully bought " .. param .. "!")
return true
else
return doPlayerSendCancel(cid, "You need " .. buyItem.money .. " gold coins to buy this item.")
end
else
return doPlayerSendCancel(cid, "Wrong param for buyable items.")
end
end
return true
end
PHP:
function onSay(cid, words, param)
if getPlayerBlessing(cid,5) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already been blessed")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
if doPlayerRemoveMoney(cid, 1000) == TRUE then
for i = 1,5 do
doPlayerAddBlessing(cid,i)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received blessings!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need 10 scarab coins for blessings.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ICEAREA)
end
end
return TRUE
end
If you edit them the cool down system, please highlight what you added coz im 100% sure that i will need the system in more commands later.
Please help me with that and i will realy appreciate it and i will add reputation to you (Rep++)
Thanks in advance,
Ranyo13