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

Lua "doPlayerAddItem(cid,item)" drops items on the ground, always.

Guitar Freak

_LüA_n☺b_
Joined
Dec 27, 2008
Messages
831
Reaction score
13
Location
Caracas, Venezuela
Hello everyone, it has been a very long time since I left the OT world but now Im coming back to it slowly due to an idea I had for a server that I want to work on, but I feel very newbie again since I forgot a lot of stuff.

I wanted it to be client 8.60 and TFS so I downloaded this distro:

http://otland.net/f18/8-60-forgotten-server-0-3-6-crying-damson-v3-147913/

Everything was going fine until I realized this function "doPlayerAddItem(cid,item)" is not working properly, it simply drops items on the ground no matter what I do it always drops it on the ground. Ive been like the past 2 hours trying to figure out what was wrong with my "firstitems" script modified everything up to the point that my firstitems script is no longer a first items script and now looks like this:

Lua:
function onLogin(cid)
	doPlayerAddItem(cid, 2120)
	return true
end
(lol)
And it still drops the items in the ground.

I did some research and a lot of people are having this same problem with this distro, so it seems to be a bug on the distro itself, but nobody gives solutions that work. However I believe the reason for this is because they formulated the question wrong (most people were thinking it was a "cap" problem, or similar).

So as you can see in my script even the simplest usage of the function is not working so Im asking again do you know how to fix this? If I have to recompile the whole thing again to fix it then try to guide me on it and Ill try to do it.

Otherwise if you cant answer that question here is another one:
What other distro do you recommend me to get considering I need it to be client 8.60 and have TFS Crying Damson's fuctions (so not mystic spirit)? (and Premium/0.4 is off the question for now, sadly)

Thanks in advance, and Ill of course +rep any working solutions.
-GF
 
Not sure, but don't you need to make it true?

Lua:
doPlayerAddItem(cid, 2120, 1)





EDIT:

Here is the first items script that I grabbed from my server
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 30001,
			items = {2050, 2382}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end

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

		if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
			doPlayerAddItem(cid, 2651, 1)
		else
			doPlayerAddItem(cid, 2650, 1)
		end

		doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
		setPlayerStorageValue(cid, config.storage, 1)
	]]></event>
</mod>
 
Not sure, but don't you need to make it true?

Lua:
doPlayerAddItem(cid, 2120, 1)





EDIT:

Here is the first items script that I grabbed from my server
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<config name="firstitems_config"><=!=[=C=D=A=T=A=[
		config = {
			storage = 30001,
			items = {2050, 2382}
		}
	]=]=></config>
	<event type="login" name="FirstItems" event="buffer"><=!=[=C=D=A=T=A=[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end

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

		if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
			doPlayerAddItem(cid, 2651, 1)
		else
			doPlayerAddItem(cid, 2650, 1)
		end

		doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
		setPlayerStorageValue(cid, config.storage, 1)
	]=]=></event>
</mod>

Thanks but Im getting the same outcome as before using the one you posted, items are dropping on the ground!

As I said, it seems like its a problem of the distribution I downloaded, so I think the solution is to modify sources and recompile which is the help Im looking for!

Or recommend another distro with those features (crying damson + 8.6 client) :)

Cheers.
 
You can try something like
Lua:
local pitem = doCreateItemEx(2120, 1)
doPlayerAddItemEx(cid, pitem)
or doPlayerAddItem(2120, 1,false)
 
Lua:
doPlayerAddItem(uid, itemid[, count/subtype[, canDropOnMap = true]])

example:
doPlayerAddItem(cid, 2195, 1, false)
 
Thanks all, but nothing worked, I realized the problem is the fact that no item can be "created" on any of your slots. For example, if you have a backpack on, and use the normal function, it drops the item on the backpack even if you are "naked", it always drops the item on the backpack (or on the floor if you have no backpack).

So I guess that is the bug and I think it can only be fixed in the sources, which makes me even more clueless #sadface

Try this one cryingdamson0.4-gui-v2, if you can't find it, just google it.

I googled it but the only link I found doesnt have any reviews from people or anything so it kinda seems unsafe, do you happen to have this yourself or know where else I can find it?

Otherwise any idea if this server:

http://otland.net/f18/8-60-otserv-0-6-3-r-6052-a-129322/

Has the usual functions of Crying Damson TFSs? I cant download to try out atm so maybe I get an answer before I get home.

Or if this one:
http://otland.net/f18/8-60-otx-server-version-2-1-a-155928/

Is safe? Since noone posted a "seal of approval". According to his description its based on CD 0.3.7 so that should work for what Im looking for but I cant tell if its safe or not.

Cheers.
 
Back
Top