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

MoveEvent Swimming v8.1! :)

cip have made another borders for swim i think

"For sure, it works only on desert tiles.
Now you're creating on map tiles from id: 4632-4643 and set actionid = 3333"

check ids from 7943 to 7954, its better instead of action id
 
Code:
function onStepIn(cid, item, position, fromPosition)
	if item.itemid == 7944 then
		posEnter = {x = position.x - 1, y = position.y, z = position.z}
		posExit = {x = position.x + 1, y = position.y, z = position.z}
	elseif item.itemid == 7946 then
		posEnter = {x = position.x + 1, y = position.y, z = position.z}
		posExit = {x = position.x - 1, y = position.y, z = position.z}
	elseif item.itemid == 7943 then
		posEnter = {x = position.x, y = position.y - 1, z = position.z}
		posExit = {x = position.x, y = position.y + 1, z = position.z}
	elseif item.itemid == 7945 then
		posEnter = {x = position.x, y = position.y + 1, z = position.z}
		posExit = {x = position.x, y = position.y - 1, z = position.z}
	elseif item.itemid == 7947 then
		posEnter = {x = position.x + 1, y = position.y + 1, z = position.z}
		posExit = {x = position.x - 1, y = position.y - 1, z = position.z}
	elseif item.itemid == 7948 then
		posEnter = {x = position.x - 1, y = position.y + 1, z = position.z}
		posExit = {x = position.x + 1, y = position.y - 1, z = position.z}
	elseif item.itemid == 7949 then
		posEnter = {x = position.x + 1, y = position.y - 1, z = position.z}
		posExit = {x = position.x - 1, y = position.y + 1, z = position.z}
	elseif item.itemid == 7950 then
		posEnter = {x = position.x - 1, y = position.y - 1, z = position.z}
		posExit = {x = position.x + 1, y = position.y + 1, z = position.z}
	elseif item.itemid == 7951 then
		posEnter = {x = position.x + 1, y = position.y + 1, z = position.z}
		posExit = {x = position.x - 1, y = position.y - 1, z = position.z}
	elseif item.itemid == 7952 then
		posEnter = {x = position.x - 1, y = position.y + 1, z = position.z}
		posExit = {x = position.x + 1, y = position.y - 1, z = position.z}
	elseif item.itemid == 7953 then
		posEnter = {x = position.x + 1, y = position.y - 1, z = position.z}
		posExit = {x = position.x - 1, y = position.y + 1, z = position.z}
	elseif item.itemid == 7954 then
		posEnter = {x = position.x - 1, y = position.y - 1, z = position.z}
		posExit = {x = position.x + 1, y = position.y + 1, z = position.z}
	end
	swimmingValue = 3330
	swimmingOutfit = { lookType = 267, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0 }
	standardType = 3331
	standardHead = 3332
	standardBody = 3333
	standardLegs = 3334
	standardFeet = 3335
	standardAddons = 3336
	standardOutfit = { lookType = getPlayerStorageValue(cid, standardType), lookHead = getPlayerStorageValue(cid, standardHead), lookBody = getPlayerStorageValue(cid, standardBody), lookLegs = getPlayerStorageValue(cid, standardLegs), lookFeet = getPlayerStorageValue(cid, standardFeeet), lookAddons = getPlayerStorageValue(cid, standardAddons) }
	if isPlayer(cid) == TRUE then
		if (getPlayerStorageValue(cid, swimmingValue) == 1) then
			doSetCreatureOutfit(cid, standardOutfit, 1)
			setPlayerStorageValue(cid, swimmingValue, 0)
			doTeleportThing(cid, posExit, TRUE)
		else
			setPlayerStorageValue(cid, standardType, getCreatureOutfit(cid).lookType)
			setPlayerStorageValue(cid, standardHead, getCreatureOutfit(cid).lookHead)
			setPlayerStorageValue(cid, standardBody, getCreatureOutfit(cid).lookBody)
			setPlayerStorageValue(cid, standardLegs, getCreatureOutfit(cid).lookLegs)
			setPlayerStorageValue(cid, standardFeet, getCreatureOutfit(cid).lookFeet)
			setPlayerStorageValue(cid, standardAddons, getCreatureOutfit(cid).lookAddons)
			doSetCreatureOutfit(cid, swimmingOutfit, 60000)
			setPlayerStorageValue(cid, swimmingValue, 1)
			doTeleportThing(cid, posEnter, TRUE)
		end
	end
return TRUE
end
yo.
using new borders, fully configurable, etc.
 
Why store each looktype parts in a lot of storages? use bitwise operators.
I am sure only one storage it is sufficient to this scirpt and instead of getting a lot of positions, use an area handler to convert it so it becomes easy and shorter.
 
Have no idea why you guys are worring about NPCs stepping in the water. Who has their npcs wandering around town aimlessly anyway lol.

@Ontopic: Great job and pretty quick release too.

I do xD

Remember the silly guy from ank that wanders around, part of the djinns quest i believe?

He's part of djinns quest in my server :D


Excellent script, i'm testing it now
 
Hello! now it works but it seems i can only go 1 sq in the water. also just splash into it. my water is bugged as i dont know wich 1 to use
 
Back
Top