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

[Movements] GetPlayerSlotItem!

slaw

Software Developer
Joined
Aug 27, 2007
Messages
3,663
Solutions
125
Reaction score
1,109
Location
Germany
GitHub
slawkens
I have made script. When player want go he must have in left hand a shovel.

Its my code:
Code:
	if item.actionid == 3602 then
		if isPlayer(cid) == TRUE then
			pozzzycja = {x=53, y=29, z=8}
			lewareka = getPlayerSlotItem(cid, 6)
			if lewareka == 2554 then
			doTeleportThing(cid, pozzzycja, FALSE)
			else
			pozzycja = {x=56, y=36, z=8}
			doTeleportThing(cid, pozzycja, FALSE)
			doPlayerSendCancel(cid, 'Put in your left hand a shovel.')
			end
		else
		doTeleportThing(cid, pozzycja, FALSE)
		end
	end


I can't understand what i have wrong in this? Always when i try to go i have: "Put in your left hand a shovel.

I think function GetPlayerSlotItem doesn't work on TFS.
 
I have made script. When player want go he must have in left hand a shovel.

Its my code:
Code:
	if item.actionid == 3602 then
		if isPlayer(cid) == TRUE then
			pozzzycja = {x=53, y=29, z=8}
			lewareka = getPlayerSlotItem(cid, 6)
			if lewareka == 2554 then
			doTeleportThing(cid, pozzzycja, FALSE)
			else
			pozzycja = {x=56, y=36, z=8}
			doTeleportThing(cid, pozzycja, FALSE)
			doPlayerSendCancel(cid, 'Put in your left hand a shovel.')
			end
		else
		doTeleportThing(cid, pozzycja, FALSE)
		end
	end


I can't understand what i have wrong in this? Always when i try to go i have: "Put in your left hand a shovel.

I think function GetPlayerSlotItem doesn't work on TFS.



Translate it to english.. so i can help
 
Code:
if item.actionid == 3602 then
	if isPlayer(cid) == TRUE then
		position_one = {x=53, y=29, z=8}
		lefthand = getPlayerSlotItem(cid, 6)
		if lefthand == 2554 then
			doTeleportThing(cid, position_one, FALSE)
		else
			position_two = {x=56, y=36, z=8}
			doTeleportThing(cid, position_two, FALSE)
			doPlayerSendCancel(cid, 'Put in your left hand a shovel.')
		end
	else
	doTeleportThing(cid, position_two, FALSE)
	end
end
 
doTeleportThing(cid, position_one, FALSE) > doTeleportThing(cid, position_one, TRUE)

Now everything is FALSE so it never teleports.

That's true but there's somting else wrong to but i just cant see what it is..

NO, its not problem with teleport ;)
If you don't know:
False - when you want just teleport.
True - when you want push creature. :)

Now i have fixed my problem.
5 line
Code:
if lefthand == 2554 then
changed on:
Code:
if lefthand.itemid == 2554 then
 
Back
Top