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

The real deal

Kramer infernal

I work alone =/
Joined
Jun 18, 2008
Messages
225
Reaction score
0
This is my problem, I want to some or someone retire a object with action ID, however, the npc couldn't handle this, so I get to switches and action id, however, it doesn't work neither, here I have the code, because I don't know what to do now...

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
playerPos = getPlayerPosition(cid)
local quest = getPlayerStorageValue(cid,8002)
 			
                    if quest == 2 then
			
		 if getPlayerItemCount(cid,5710).actionid == 8002 then
			doPlayerRemoveItem(cid,5710).actionid = 8002
			doPlayerSendTextMessage(cid,22,'Oh thanks for bring me back my shovel! Take the wisdom of the worker and an additional fee!')
			doPlayerAddItem(cid,2152,70)
			doPlayerAddExp(cid,8000)
			setPlayerStorageValue(cid,8002,3)

end         
else
doCreatureSay(cid, 'I\'m not ready to switch this.', TALKTYPE_ORANGE_1)
return TRUE
end
end
 
idk but you can try like that:
Code:
(getPlayerItemCount(cid,5710).actionid == 8002) > 0
and
Code:
item = getPlayerItemCount(cid, 5710).actionid == 8002
doPlayerRemoveItem(cid, item, 1)

Guess it wont fix anything :S
 
You may solve it by forcing player to keep it in his hands and then check if item_left_hand.actionid == x or item_right_hand.actionid == x

I guess it's the only way.
 
Well, another try :P
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local quest = getPlayerStorageValue(cid,8002)		
	if quest == 2 then	
		if (doPlayerRemoveItem(cid, 5710, 1).actionid == 8002) == TRUE then
			doPlayerSendTextMessage(cid,22,'Oh thanks for bring me back my shovel! Take the wisdom of the worker and an additional fee!')
			doPlayerAddItem(cid,2152,70)
			doPlayerAddExp(cid,8000)
			setPlayerStorageValue(cid,8002,3)    
		end    
	else
		doCreatureSay(cid, 'I\'m not ready to switch this.', TALKTYPE_ORANGE_1)
	end
	return TRUE
end

and btw - you dont need playerPos in such kind of scripts o_o
 
Oh sorry xD i'm too busy and I forget things...
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local quest = getPlayerStorageValue(cid,8002)
 			
                if quest == 2 then
			
            item = getPlayerSlotItem(5710, 10).actionid == 8002
            if doPlayerRemoveItem(cid, item, 1) then
			doPlayerSendTextMessage(cid,22,'Oh thanks for bring me back my shovel! Take the wisdom of the worker and an additional fee!')
			doPlayerAddItem(cid,2152,70)
			doPlayerAddExp(cid,8000)
			setPlayerStorageValue(cid,8002,3)

                      else
                      doPlayerSendTextMessage(cid,22,'Well, you need the boula shovel to end this quest buddy...')
                      end
else
doCreatureSay(cid, 'I\'m not ready to switch this.', TALKTYPE_ORANGE_1)
return TRUE
end
      end

@offtopic: am busy making 30 quests xD forwarding 4 days, because am gonna take some vacations :D

@Btw, gratz post 666 xDD
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local quest = getPlayerStorageValue(cid,8002)
	if quest == 2 then
		if getPlayerSlotItem(cid, CONST_SLOT_LEFT).actionid == 8002 then
            		doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_LEFT), 1)
			doPlayerSendTextMessage(cid,22,'Oh thanks for bring me back my shovel! Take the wisdom of the worker and an additional fee!')
			doPlayerAddItem(cid,2152,70)
			doPlayerAddExp(cid,8000)
			setPlayerStorageValue(cid,8002,3)
		elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT).actionid == 8002 then
			doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_RIGHT), 1)
			doPlayerSendTextMessage(cid,22,'Oh thanks for bring me back my shovel! Take the wisdom of the worker and an additional fee!')
			doPlayerAddItem(cid,2152,70)
			doPlayerAddExp(cid,8000)
			setPlayerStorageValue(cid,8002,3)
                else
                	doPlayerSendTextMessage(cid,22,'Well, you need the boula shovel to end this quest buddy...')
                end
	else
		doCreatureSay(cid, 'I\'m not ready to switch this.', TALKTYPE_ORANGE_1)
	end
return TRUE
end

Hope it works now :blink:
 
An idea would be to replace:
Code:
doPlayerRemoveItem(cid, getPlayerSlotItem(cid, CONST_SLOT_RIGHT), 1)

With

Code:
doPlayerRemoveItem(cid,xxxx,1)

And instead of him carrying a shovel, he could carry a light shovel? And make it only possible to obtain light shovel through this quest.

Or just replace it with a regular shovel id:
Code:
doPlayerRemoveItem(cid,2554,1)
(but then it will remove a shovel - might not be exacly the shovel with action id 8002, but who cares?) Normal players cant see any diffrence if they are using a shovel without action id and with action id. (i think).
 
Last edited:
Yes, I can do that but... my server will have tons of all items, I need the action id to separate those items... at least I... I think I got it thank you Z-Note for bring me the idea :* however I need this mistery solve xD maybe other can need it
 
Back
Top