• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

First items priority

Wavoz

Oldschooler
Joined
Jul 10, 2011
Messages
1,021
Reaction score
84
So i have been trying to figure out how do i get first items spawn on the required slots.
eq.png
eq2.png


No matter what i do rope and shovel keep spawning on "hands" but i want them to spawn in container.
Script looks like that:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="XXX" contact="otland.net" enabled="yes">
<config name="firstitems_config"><![CDATA[
config = {
storage = 30001,
items = {2463, 2525, 2457, 2647, 2643}
}
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')
 
function onLogin(cid)
if(getPlayerStorageValue(cid, config.storage) > 0) then
return true
end

doPlayerSetMaxCapacity(cid, 520) 
doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2674, 10)
doPlayerAddItem(cid, 2120, 1)
doPlayerAddItem(cid, 2554, 1)
doPlayerAddItem(cid, 7620, 1)

if (getPlayerVocation(cid) == 1) then
doPlayerAddItem(cid, 2190, 1)
elseif (getPlayerVocation(cid) == 2) then
doPlayerAddItem(cid, 2182, 1)
elseif (getPlayerVocation(cid) == 3) then
doPlayerAddItem(cid, 2456, 1)
doPlayerAddItem(cid, 2544, 1)
elseif (getPlayerVocation(cid) == 4) then
doPlayerAddItem(cid, 2383)
doPlayerAddItem(cid, 2428)
doPlayerAddItem(cid, 2417)
end

doPlayerSetMaxCapacity(cid, 540) 
 
for _, id in ipairs(config.items) do
doPlayerAddItem(cid, id, 1)
end
 

 
setPlayerStorageValue(cid, config.storage, 1)
 
setPlayerStorageValue(cid, 19732, 100)
return true
end
]]></event>
</mod>

I have changed order of items but still i don't understand why does rope and shovel want to spawn on hands slot....
 
begin with head, and down. The bag should be last.
So:
1. Head
2. Armor
3. Legs
4. Boots
5. Hand Left
6. Hand Right
7. Arrows
8. Ring
9. Bag

And now what ever you put in, it will appear in the bag.
 
I have tried that, everything works fine but rope appears in my left hand and dwarven shield is in container...
Changed items order to: Helmet, Armor, Legs, Boots, Shield
Code:
items = {2457, 2463, 2647, 2643, 2525}
Still rope appears in my hand instead of dwarven shield, other hand has weapon.

Edit: Working perfectly now!
I removed dwarven shield from:
Code:
items = {2457, 2463, 2647, 2643, [B]2525[/B]}
and added it before rope to container items and it somehow appears in my hand slot now!
Code:
doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2674, 10)
[B]doPlayerAddItem(cid, 2525, 1)[/B]
doPlayerAddItem(cid, 2120, 1)
doPlayerAddItem(cid, 2554, 1)
doPlayerAddItem(cid, 7620, 1)
Didn't make too much sense to me but it works now!
Thread can be closed.
 
Last edited:
doPlayerAddItem(uid, itemid[, count/subtype = 1[, canDropOnMap = true[, slot = 0]]])

slot = where u want to put item, for example:

doPlayerAddItem(uid, itemid, 1, true, CONST_SLOT_HEAD)


rep me ;d
 
Back
Top