Captin amr
Error
- Joined
- Jun 20, 2009
- Messages
- 59
- Reaction score
- 0
im give you name my server if you can add !aol add it and give me it ok?
name serv >>NaxedOt - 8.52
name serv >>NaxedOt - 8.52
local shop = {
["aol"] = { id = 2173, count = 1, cost = 10000 },
["backpack"] = { id = 1988, count = 1, cost = 50 }
}
function onSay(cid, words, param, channel)
local cfg = shop[param]
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
elseif(getPlayerMoney(cid) < cfg.cost) then
doPlayerSendCancel(cid, "You do not have enough money.")
else
doPlayerRemoveMoney(cid, cfg.cost)
doPlayerAddItem(cid, cfg.id, cfg.count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased " .. getItemNameById(cfg.id) .. ".")
end
return true
end
local shop = {
["aol"] = { id = 2173, count = 1, cost = 10000 },
["backpack"] = { id = 1988, count = 1, cost = 50 }
}
function onSay(cid, words, param, channel)
local cfg = shop[param]
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
elseif(getPlayerMoney(cid) < cfg.cost) then
doPlayerSendCancel(cid, "You do not have enough money.")
else
doPlayerRemoveMoney(cid, cfg.cost)
doPlayerAddItem(cid, cfg.id, cfg.count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased " .. getItemNameById(cfg.id) .. ".")
end
return true
end
function onSay(cid, words, param)
local random_backpack = {1988, 2000, 1998, 1999, 2001, 2002, 2003, 2004, 10519, 5949, 3940, 7342, 9774, 11115, 11235, 11237, 11238, 11257}
local randomChance = math.random(1, #random_backpack)
local count = 1
if(randomChance == 1) then
count = 1
elseif(randomChance == 2) then
count = 1
end
if doPlayerRemoveMoney(cid, 100) == 1 then
doCreatureSay(cid, 'You bought ' ..getItemName(random_backpack[randomChance])..' for 100 gold coins!', TALKTYPE_ORANGE_1)
doPlayerAddItem(cid, random_backpack[randomChance], count)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLOCKHIT)
else
doPlayerSendCancel(cid, 'You don\'t have enough money.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
Code:local shop = { ["aol"] = { id = 2173, count = 1, cost = 10000 }, ["backpack"] = { id = 1988, count = 1, cost = 50 } } function onSay(cid, words, param, channel) local cfg = shop[param] if(param == "") then doPlayerSendCancel(cid, "Command requires param.") elseif(getPlayerMoney(cid) < cfg.cost) then doPlayerSendCancel(cid, "You do not have enough money.") else doPlayerRemoveMoney(cid, cfg.cost) doPlayerAddItem(cid, cfg.id, cfg.count) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased " .. getItemNameById(cfg.id) .. ".") end return true end