Zombiegod
Active Member
- Joined
- Oct 22, 2009
- Messages
- 198
- Solutions
- 1
- Reaction score
- 25
Code:
local mounts = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42}
local daily = getPlayerStorageValue(cid, 13541)
local daysvalue = 60
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerAccess(cid, 0) then
if getPlayerStorageValue(cid, getItemDescriptions(18423), 0) then
if getItemDescriptions == 'No one owns this.' then
doSetItemDesc( .. getPlayerName(cid) .. 'owns this.') then
if getPlayerStorageValue(cid,getItemDescriptions(cid), 0) then
setPlayerStorageValue(cid,getItemDescriptions(cid), 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Sorry someone else owns that.')
end
end
end
if getPlayerStorageValue(cid, getItemDescriptions(cid), 1) then
doPlayerAddMount(math.random(#mounts))
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_SOUND_BLUE)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Sorry someone else owns that.')
end
if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13540, time)
setPlayerStorageValue(cid, 13541, daily+1)
local daily = getPlayerStorageValue(cid, 13541)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. daily .. " Daily Mount. Enjoy.")
elseif (daily == 42) then
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You recived all possible mounts")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily mount. Next available mount will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end