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

Bug, item doesnt dissaper when i used it.

Drakos

Banned User
Joined
May 27, 2008
Messages
218
Reaction score
1
Location
Poland
Code:
function onUse(cid, item, frompos, item2, topos)

	if item.itemid == 2364 then 
   
        if doPlayerRemoveItem(cid,7460,1) == 1 then
           doPlayerAddItem(cid,8908,1)
           doPlayerAddItem(cid,2501,1)
	doPlayerRemoveItem(cid,2364,1)
	doPlayerSendTextMessage(cid,21,"bla bla bla")

       else
           doPlayerSendCancel(cid, "You do not have any items to uprgade!")
       end
end
       return 1
   end

why this function only removed item 7460 when i hold it ? When it is on the ground it doesnt dissapear.

Someone could help me ?
 
doPlayerRemoveItem(cid,2364,1)
this mean that its removing from player not from ground

I would do this way

PHP:
function onUse(cid, item, frompos, item2, topos)

if item.itemid == 2364 then 
   
	if doPlayerRemoveItem(cid,7460,1) == TRUE then
		if doPlayerRemoveItem(cid,2364,1) == TRUE then
			doPlayerAddItem(cid,8908,1)
			doPlayerAddItem(cid,2501,1)
			doPlayerSendTextMessage(cid,21,"bla bla bla")
		else
			doPlayerSendCancel(cid, "You do not have any items to uprgade!")
		end
	else
		doPlayerSendCancel(cid, "You do not have any items to uprgade!")
	end
end
return 1
end
 
Last edited:
its newest tfs version?
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2364 then
	if doPlayerRemoveItem(cid,7460,1) == TRUE then
		if doPlayerRemoveItem(cid,2364,1) == TRUE then
			doPlayerAddItem(cid,8908,1)
			doPlayerAddItem(cid,2501,1)
			doPlayerSendTextMessage(cid,21,"bla bla bla")
		else
			doPlayerSendCancel(cid, "You do not have any items to uprgade!")
		end
	else
		doPlayerSendCancel(cid, "You do not have any items to uprgade!")
	end

end
return TRUE
end
 
You are wrong man this one works when used it will remove the item...

PHP:
function onUse(cid, item, frompos, item2, topos)
    if item.itemid == 2364 then 
        if doPlayerRemoveItem(cid,7460,1) == 1 then
			doPlayerAddItem(cid,8908,1)
			doPlayerAddItem(cid,2501,1)
			doPlayerRemoveItem(cid,2364,1)
			doPlayerSendTextMessage(cid,21,"bla bla bla")
			doRemoveItem(item.uid,1)
       else
           doPlayerSendCancel(cid, "You do not have any items to uprgade!")
       end
	end
return 1
end
 
[i make in this way on my ot ;)

In actions.xml

PHP:
	<action itemid="2354" script="quests/pro update.lua" />


and in actions/scripts/pro update

PHP:
function onUse(cid, item, frompos, item2, topos)

	if item.itemid == 2354 then 
   
        if doPlayerRemoveItem(cid,8931,1) == 1 then
           doPlayerAddItem(cid,8932,1)
	doPlayerRemoveItem(cid,2354,1)
	doPlayerSendTextMessage(cid,21,"Your weapon has been upgraded!")

	elseif item.itemid == 2354 then 
   
        if doPlayerRemoveItem(cid,8925,1) == 1 then
           doPlayerAddItem(cid,7434,1)
	doPlayerRemoveItem(cid,2354,1)
	doPlayerSendTextMessage(cid,21,"Your weapon has been upgraded!")
	
	elseif item.itemid == 2354 then 
   
        if doPlayerRemoveItem(cid,7422,1) == 1 then
           doPlayerAddItem(cid,7429,1)
	doPlayerRemoveItem(cid,2354,1)
	doPlayerSendTextMessage(cid,21,"Your weapon has been upgraded!")

	elseif item.itemid == 2354 then 
   
        if doPlayerRemoveItem(cid,8850,1) == 1 then
           doPlayerAddItem(cid,8851,1)
	doPlayerRemoveItem(cid,2354,1)
	doPlayerSendTextMessage(cid,21,"Your weapon has been upgraded!")

	elseif item.itemid == 2354 then 

        if doPlayerRemoveItem(cid,8920,1) == 1 then
           doPlayerAddItem(cid,8922,1)
	doPlayerRemoveItem(cid,2354,1)
	doPlayerSendTextMessage(cid,21,"Your weapon has been upgraded!")
       else
           doPlayerSendCancel(cid, "You do not have any pro items to uprgade!")
       end
end
end
end
end
end
   
       return 1
   end
You can change the Upgrader id and items id :) hope i help you :p
 
Back
Top