bsdailha333
New Member
- Joined
- Mar 3, 2015
- Messages
- 39
- Reaction score
- 0
please help me !!
Where do you get this key in first place?
function onUse(cid, item, frompos, item2, topos) -- if something is used
if getPlayerStorageValue(cid,45000) < 1 then -- checks a specific player storage, if correct continue
doPlayerSendTextMessage(cid,22,"You have found a copper key.") -- tells the player something
local CopperKey = doPlayerAddItem(cid,2089,1) -- Adds key to player. 2089 is the itemID
doSetItemActionId(CopperKey, 45001) -- sets actionID to the item added
doItemSetAttribute(CopperKey, "description", "The word 'Prison' is inscribed into the key.") -- Sets an additional description (if wanted)
setPlayerStorageValue(cid,45000,1) -- changes storage value, so quest will be 'finished'.
else -- if the 'if' statement is false then do this.
doPlayerSendTextMessage(cid,22,"The chest is empty. You've already done this quest!") -- tells player they have already done the quest
return false -- tells the server that nothing should happen further
end -- ends the if statement
return true -- tells the server that the script executed properly
end -- ends the function 'onUse'.
-- <action uniqueid="45082" event="script" value="addons/citizen.lua"/> -- Actions.xml
function onUse(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,45000) < 1 then
doPlayerSendTextMessage(cid,22,"You have found a copper key.")
local CopperKey = doPlayerAddItem(cid,2089,1)
doSetItemActionId(CopperKey, 45001)
doItemSetAttribute(CopperKey, "description", "The word 'Prison' is inscribed into the key.")
setPlayerStorageValue(cid,45000,1)
else
doPlayerSendTextMessage(cid,22,"The chest is empty. You've already done this quest!")
return false
end
return true
end
-- <action uniqueid="45082" event="script" value="addons/citizen.lua"/> -- Actions.xml
Without greentext.Code:function onUse(cid, item, frompos, item2, topos) -- if something is used if getPlayerStorageValue(cid,45000) < 1 then -- checks a specific player storage, if correct continue doPlayerSendTextMessage(cid,22,"You have found a copper key.") -- tells the player something local CopperKey = doPlayerAddItem(cid,2089,1) -- Adds key to player. 2089 is the itemID doSetItemActionId(CopperKey, 45001) -- sets actionID to the item added doItemSetAttribute(CopperKey, "description", "The word 'Prison' is inscribed into the key.") -- Sets an additional description (if wanted) setPlayerStorageValue(cid,45000,1) -- changes storage value, so quest will be 'finished'. else -- if the 'if' statement is false then do this. doPlayerSendTextMessage(cid,22,"The chest is empty. You've already done this quest!") -- tells player they have already done the quest return false -- tells the server that nothing should happen further end -- ends the if statement return true -- tells the server that the script executed properly end -- ends the function 'onUse'. -- <action uniqueid="45082" event="script" value="addons/citizen.lua"/> -- Actions.xml
Code:function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid,45000) < 1 then doPlayerSendTextMessage(cid,22,"You have found a copper key.") local CopperKey = doPlayerAddItem(cid,2089,1) doSetItemActionId(CopperKey, 45001) doItemSetAttribute(CopperKey, "description", "The word 'Prison' is inscribed into the key.") setPlayerStorageValue(cid,45000,1) else doPlayerSendTextMessage(cid,22,"The chest is empty. You've already done this quest!") return false end return true end -- <action uniqueid="45082" event="script" value="addons/citizen.lua"/> -- Actions.xml
[Error - Action Interface]
data/actions/scripts/bauquests/chavemorte.lua:onUse
Description:
data/actions/scripts/bauquests/chavemorte.lua:5: attempt to call global 'doSetItemActionId' (a nil value)
stack traceback:
data/actions/scripts/bauquests/chavemorte.lua:5: in function <data/actions/scripts/bauquests/chavemorte.lua:1>
function onUse(cid, item, frompos, item2, topos) -- if something is used
if getPlayerStorageValue(cid,1004) < 1 then -- checks a specific player storage, if correct continue
doPlayerSendTextMessage(cid,22,"You have found a copper key.") -- tells the player something
local CopperKey = doPlayerAddItem(cid,2091,1) -- Adds key to player. 2089 is the itemID
doSetItemActionId(CopperKey, 2091) -- sets actionID to the item added
doItemSetAttribute(CopperKey, "description", "lalilulelo.") -- Sets an additional description (if wanted)
setPlayerStorageValue(cid,1004,1) -- changes storage value, so quest will be 'finished'.
else -- if the 'if' statement is false then do this.
doPlayerSendTextMessage(cid,22,"The chest is empty!") -- tells player they have already done the quest
return false -- tells the server that nothing should happen further
end -- ends the if statement
return true -- tells the server that the script executed properly
end -- ends the function 'onUse'.
add this to data/lib/050-functionSorry if I'm reviving this topic. But i'm trying to use this script, but I always receives the following error:
Lua:[Error - Action Interface] data/actions/scripts/bauquests/chavemorte.lua:onUse Description: data/actions/scripts/bauquests/chavemorte.lua:5: attempt to call global 'doSetItemActionId' (a nil value) stack traceback: data/actions/scripts/bauquests/chavemorte.lua:5: in function <data/actions/scripts/bauquests/chavemorte.lua:1>
I'm also using 0.3.6 CD.
Heres my script:
(the action ID is also 2091.....)
Lua:function onUse(cid, item, frompos, item2, topos) -- if something is used if getPlayerStorageValue(cid,1004) < 1 then -- checks a specific player storage, if correct continue doPlayerSendTextMessage(cid,22,"You have found a copper key.") -- tells the player something local CopperKey = doPlayerAddItem(cid,2091,1) -- Adds key to player. 2089 is the itemID doSetItemActionId(CopperKey, 2091) -- sets actionID to the item added doItemSetAttribute(CopperKey, "description", "lalilulelo.") -- Sets an additional description (if wanted) setPlayerStorageValue(cid,1004,1) -- changes storage value, so quest will be 'finished'. else -- if the 'if' statement is false then do this. doPlayerSendTextMessage(cid,22,"The chest is empty!") -- tells player they have already done the quest return false -- tells the server that nothing should happen further end -- ends the if statement return true -- tells the server that the script executed properly end -- ends the function 'onUse'.
function doSetItemActionId(uid, actionid)
return doItemSetAttribute(uid, "aid", actionid)
end