local config ={
storage = {1234, 4321}, -- {storage for premium, storage for free}
items = {1234, 4321} -- {item for premium, item for free}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPremium(cid) then
if getPlayerStorageValue(cid, config.storage[1]) == -1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[1]))
doPlayerAddItem(cid, config.items[1], 1)
setPlayerStorageValue(cid, config.storage[1], 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
else
if getPlayerStorageValue(cid, config.storage[2]) == -1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[2]))
doPlayerAddItem(cid, config.items[2], 1)
setPlayerStorageValue(cid, config.storage[2], 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
end
return TRUE
end
LUA:local config ={ storage = {1234, 4321}, -- {storage for premium, storage for free} items = {1234, 4321} -- {item for premium, item for free} } function onUse(cid, item, fromPosition, itemEx, toPosition) if isPremium(cid) then if getPlayerStorageValue(cid, config.storage[1]) == -1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[1])) doPlayerAddItem(cid, config.items[1], 1) setPlayerStorageValue(cid, config.storage[1], 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") end else if getPlayerStorageValue(cid, config.storage[2]) == -1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(config.items[2])) doPlayerAddItem(cid, config.items[2], 1) setPlayerStorageValue(cid, config.storage[2], 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") end end return TRUE end
error?