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

how to make the action id a certain fixed item?

what an actual ** you just said?o_O
Can you explain a bit better what do you want to do.

And what server version you are using
 
I use
TheForgottenServer, version 0.3.6 (Crying Damson)
Compiled with GNU C ++ version 3.4.5 (mingw special) at Jul 16 2011 12:10:57.
The server developed by Elf, slawkens, Talaturen, KaczooH, Lithium, Kiper, Kornholijo.
Visit our forum for updates, support and resources: http://otland.net.



I did a quest ... and enter the quest is required a key to actionId 1222 ... every time takes place by / attr actionId 1222
was wondering if it would become fixed without having to keep changing
 
So you want action id 1222 key always open that door and nothing else, even if key looks the same?
 
what the heck are you trying to do>.>
if you have totally new sprite for key, u don't need action id in first place.
Perhaps use unique id instead of action id.
Where do you get this key in first place? maybe you just dont know how to set action id on key with script.
 
I did a quest and enter the quest need the key
this has to put the "actionId" on the door and the key ...
at the door saved by "Remere's Map Editor" ..but not the key ...
how do I put a "actionId" permanete an item ??
I tried to put in item.xml "<attribute key =" actionId "value =" 1222 "/>" "but it works not want to know if it is possible to do" if yes how?
 
so in the quest where you obtain the key add this line to give the key the action id... do note change itemEx.uidas that might not work.
doSetItemActionId(itemEx.uid, #example 9218)
 
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
Without greentext.
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
 
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
Without greentext.
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

Sorry 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'.
 
Sorry 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'.
add this to data/lib/050-function
Code:
function doSetItemActionId(uid, actionid)
   return doItemSetAttribute(uid, "aid", actionid)
end
 
Back
Top