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

Tfs version 0.3.5 (Crying Damson) ""getPlayerItemCount" ...

Tovar

Brak V
Joined
Jul 26, 2008
Messages
347
Reaction score
8
someone know if this function work fine in version 0.3.5 (Crying Damson)??, I made, and found some scripts with this function, and do "NOTHING", in the Magic wall entrance in poi, all the scripts work, but the tile didnt =/, there is my 2 script of poi and blue legs... if are wrong please correct it for me =/, I dont know if is the script or the Tfs...

POI:

Code:
function onStepIn(cid, item, pos)
	local position = {x=412, y=1414, z=9}
	local position2 = {x=398, y=1380, z=9}
	
		if (getPlayerItemCount(cid, 1970) < 1) then
			doTeleportThing(cid, position)
			doSendMagicEffect(position,10)
		else

			doTeleportThing(cid, position2)
						doSendMagicEffect(position2,10)
		end
end

Blue Legs:

Code:
function onStepIn(cid, item, position, fromPosition)
 
Scheck = getPlayerStorageValue(cid, 83234)
ItemCheck = getPlayerItemCount(cid,8266)
out =  {x=position.x, y=position.y-1, z=position.z}
Spawn =  {x=position.x, y=position.y-10, z=position.z}
 
--Check Begin
 
--Area Check
starting={x=33264, y=32402, z=12, stackpos=253} --Top left corner
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending=  {x=33278, y=32417, z=12, stackpos=253} --Bottom right corner
--Area Check
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
if creature.itemid > 0 then
if isPlayer(creature.uid) == 1 then
players=players+1
end
if isCreature(creature.uid) then
totalmonsters=totalmonsters+1
monster[totalmonsters]=creature.uid
   end
end
checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
--Check Ending
 
if players == 0 and totalmonsters == 0 and ItemCheck > 0 then
	doSummonCreature("Koshei The Deathless", Spawn)
 
 
elseif players==0 then
 
current=0
repeat
current=current+1
doRemoveCreature(monster[current])
until current>=totalmonsters
end
end

Thanks in Advance. ;)
 
well try this hope it works dont forget Rep++ :)

first script will be

Code:
function onStepIn(cid, item, pos)
	local position = {x=412, y=1414, z=9}
	local position2 = {x=398, y=1380, z=9}
	
		if doPlayerRemoveItem(cid,1970,1) == TRUE then
                    doTeleportThing(cid, position2)
		    doSendMagicEffect(position2,10)
 	else
			doTeleportThing(cid, position)
			doSendMagicEffect(position,10)
		end
end

second script will be

Code:
function onStepIn(cid, item, position, fromPosition)
 
Scheck = getPlayerStorageValue(cid, 83234)
ItemCheck = doRemovePlayerItem(cid,8266,1)
out =  {x=position.x, y=position.y-1, z=position.z}
Spawn =  {x=position.x, y=position.y-10, z=position.z}
 
--Check Begin
 
--Area Check
starting={x=33264, y=32402, z=12, stackpos=253} --Top left corner
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending=  {x=33278, y=32417, z=12, stackpos=253} --Bottom right corner
--Area Check
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
if creature.itemid > 0 then
if isPlayer(creature.uid) == 1 then
players=players+1
end
if isCreature(creature.uid) then
totalmonsters=totalmonsters+1
monster[totalmonsters]=creature.uid
   end
end
checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
--Check Ending
 
if players == 0 and totalmonsters == 0 and ItemCheck == TRUE then
	doSummonCreature("Koshei The Deathless", Spawn)
 
 
elseif players==0 then
 
current=0
repeat
current=current+1
doRemoveCreature(monster[current])
until current>=totalmonsters
end
end

good luck :D
 
hey bro, thanks for you help, but I dont need that script remove the item, I just need that script Check "IF THE PLAYER HAVE THE ITEM", is possible? or this function dont work on tfs?
 
its ok, thanks u very much, i love when the people help xD, if someone need me just pm or msg me :D

PD; WHERE I PUT RETURN TRUE? this is needed?
 
nvm fixed! the problem was on the movements.xml, was event= and the right was type=.... thanks very much for help guys
 
Back
Top