• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Blue legs

Rivao

New Member
Joined
Mar 2, 2010
Messages
58
Reaction score
0
Something is worng with this script, because the players can take infinite of times the reward.
Can someone check it?

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local outPos = {x=33270, y=32446, z=12} 
local chest = {
    rewards = {
    [36204] = 7730,
    },
    storageId = 36205
}
    if chest.rewards[item.uid] ~= nil then
        if getPlayerStorageValue(cid, chest.storageId) == -1 then
            doPlayerSendTextMessage(cid,25,"You have found a ".. getItemNameById(chest.rewards[item.uid]) ..".")
            doPlayerAddItem(cid, chest.rewards[item.uid], 1)
	     doPlayerAddItem(cid, 2152, 50)
	     doTeleportThing(cid, newPos, TRUE)
            setPlayerStorageValue(cid, chest.storageId, 1)
        else
            doPlayerSendTextMessage(cid,25,"It is empty.")
        end
    end
    return true
end
 
Something is worng with this script, because the players can take infinite of times the reward.
Can someone check it?

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local outPos = {x=33270, y=32446, z=12} 
local chest = {
    rewards = {
    [36204] = 7730,
    },
    storageId = 36205
}
    if chest.rewards[item.uid] ~= nil then
        if getPlayerStorageValue(cid, chest.storageId) == -1 then
            doPlayerSendTextMessage(cid,25,"You have found a ".. getItemNameById(chest.rewards[item.uid]) ..".")
            doPlayerAddItem(cid, chest.rewards[item.uid], 1)
	     doPlayerAddItem(cid, 2152, 50)
	     doTeleportThing(cid, newPos, TRUE)
            setPlayerStorageValue(cid, chest.storageId, 1)
        else
            doPlayerSendTextMessage(cid,25,"It is empty.")
        end
    end
    return true
end

Hmm, really wierd cuz that script works for me..
 
Back
Top