• 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!

Weapon Random Quest

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
Don't are working...
Help-me!

Error:
603d1fd576cb0cbb8a54f919fc36cb32.jpg


Script:
PHP:
function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5008 then
queststatus = getPlayerStorageValue(cid,5008)
    if queststatus == -1 then
        if playerCap >= itemWeight then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
            doPlayerAddItem(cid, item.uid ,1)
            setPlayerStorageValue(cid, item.uid, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
	elseif queststatus == 1 then
		doPlayerSendTextMessage(cid,22,"Puff!!")
		ran = math.random(1, 3)
		if ran == 1 then
			doPlayerAddItem(cid, 2376, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2376) .. '.')
		elseif ran == 2 then
			doPlayerAddItem(cid, 2382, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2382) .. '.')
		elseif ran == 3 then
			doPlayerAddItem(cid, 2386, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2386) .. '.')
		end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
end
return TRUE
end
 
Last edited:
What a stupid piece of script you ve done, you dont even know what you trying to handle.

Code:
--Weapon Quest
function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5008 then
queststatus = getPlayerStorageValue(cid,5006)
    if queststatus == -1 then
        if playerCap >= itemWeight then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
            doPlayerAddItem(cid, item.uid ,1)
            setPlayerStorageValue(cid, item.uid, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
	elseif queststatus == 1 then
		doPlayerSendTextMessage(cid,22,"Puff!!")
		ran = math.random(1, 3)
		if ran == 1 then
			doPlayerAddItem(cid, 2376, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2376) .. '.')
		elseif ran == 2 then
			doPlayerAddItem(cid, 2382, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2382) .. '.')
		elseif ran == 3 then
			doPlayerAddItem(cid, 2386, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2386) .. '.')
		end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
end
return TRUE
end
 
just must define playerCap and itemWeight

Try this...
Code:
function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5008 then
queststatus = getPlayerStorageValue(cid,5008)
    if queststatus == -1 then
        local itemWeight = getItemWeight(item.uid, 1)
        local playerCap = getPlayerFreeCap(cid)
        if playerCap >= itemWeight then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
            doPlayerAddItem(cid, item.uid ,1)
            setPlayerStorageValue(cid, item.uid, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
    elseif queststatus == 1 then
        doPlayerSendTextMessage(cid,22,"Puff!!")
        ran = math.random(1, 3)
        if ran == 1 then
            doPlayerAddItem(cid, 2376, 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2376) .. '.')
        elseif ran == 2 then
            doPlayerAddItem(cid, 2382, 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2382) .. '.')
        elseif ran == 3 then
            doPlayerAddItem(cid, 2386, 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2386) .. '.')
        end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
end
return TRUE
end
 
Last edited:
What a stupid piece of script you ve done, you dont even know what you trying to handle.

Code:
--Weapon Quest
function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5008 then
queststatus = getPlayerStorageValue(cid,5006)
    if queststatus == -1 then
        if playerCap >= itemWeight then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
            doPlayerAddItem(cid, item.uid ,1)
            setPlayerStorageValue(cid, item.uid, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
	elseif queststatus == 1 then
		doPlayerSendTextMessage(cid,22,"Puff!!")
		ran = math.random(1, 3)
		if ran == 1 then
			doPlayerAddItem(cid, 2376, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2376) .. '.')
		elseif ran == 2 then
			doPlayerAddItem(cid, 2382, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2382) .. '.')
		elseif ran == 3 then
			doPlayerAddItem(cid, 2386, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(2386) .. '.')
		end
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
end
return TRUE
end

It seems you are even worser... You also didnt define playerCap AND itemWeight. That is the error.

@Threadmaker: you need to say what playerCap And itemWeight are.
like local playerCap = getplayercap and local itemWeight = getitemweight.
 
Why don't you made a new one?
I bet you'll need the half time for making a new then editing something completly bugged ^^

yours Evil Hero,
 
Last edited by bomba; Today at 12:20.
there before was writed


Code:
--Weapon Quest
function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5008 then
queststatus = getPlayerStorageValue(cid,5006)
if questatus == 1 then
random = math.
doPlayerAddItem(cid, 2376, 1) and random then
doPlayerAddItem(cid, 2382, 1) and random then
doPlayerAddItem(cid, 2382, 1) and random then
    if queststatus == -1 then
        if playerCap >= itemWeight then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
            doPlayerAddItem(cid, item.uid ,1)
            setPlayerStorageValue(cid, item.uid, 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end

    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
end
return TRUE
end

do you really think mine is more messed than it?
LOL
 
Back
Top