Postado Outubro 30, 2012 12 anos Eu to usando um sistema de natação, ele funciona certinho, só que na hora do player voltar pra terra ele continua nadando. Alguém sabe como arrumar isso? swimm.lua function onStepIn(cid, item, position, fromPosition) swimvalue = 3330 --storagevalue to check diveroutfit = { lookType = 267, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookAddons = 0 } standardoutfit = { lookType = getPlayerStorageValue(cid, 3331), lookHead = getPlayerStorageValue(cid, 3332), lookBody = getPlayerStorageValue(cid, 3333), lookLegs = getPlayerStorageValue(cid, 3334), lookFeet = getPlayerStorageValue(cid, 3335), lookAddons = getPlayerStorageValue(cid, 3336) } isswimming = getPlayerStorageValue(cid, swimvalue) if isPlayer(cid) then if (isswimming == -1) or (isswimming == 2) then pozycja = {x = 124, y = 58, z= 7} if item.itemid == 4632 then pos = {x = position.x - 3, y = position.y - 2, z = position.z} elseif item.itemid == 4633 then pos = {x = position.x - 3, y = position.y, z = position.z} elseif item.itemid == 4634 then pos = {x = position.x + 2, y = position.y + 2, z = position.z} elseif item.itemid == 4635 then pos = {x = position.x + 2, y = position.y, z = position.z} elseif item.itemid == 4636 then pos = {x = position.x + 2, y = position.y + 2, z = position.z} elseif item.itemid == 4637 then pos = {x = position.x - 3, y = position.y + 2, z = position.z} elseif item.itemid == 4638 then pos = {x = position.x + 2, y = position.y - 2, z = position.z} elseif item.itemid == 4639 then pos = {x = position.x - 3, y = position.y - 2, z = position.z} elseif item.itemid == 4640 then pos = {x = position.x + 2, y = position.y + 2, z = position.z} elseif item.itemid == 4641 then pos = {x = position.x - 3, y = position.y + 2, z = position.z} elseif item.itemid == 4642 then pos = {x = position.x + 2, y = position.y - 2, z = position.z} elseif item.itemid == 4643 then pos = {x = position.x - 3, y = position.y - 2, z = position.z} end setPlayerStorageValue(cid, 3331, getCreatureOutfit(cid).lookType) setPlayerStorageValue(cid, 3332, getCreatureOutfit(cid).lookHead) setPlayerStorageValue(cid, 3333, getCreatureOutfit(cid).lookBody) setPlayerStorageValue(cid, 3334, getCreatureOutfit(cid).lookLegs) setPlayerStorageValue(cid, 3335, getCreatureOutfit(cid).lookFeet) setPlayerStorageValue(cid, 3336, getCreatureOutfit(cid).lookAddons) setPlayerStorageValue(cid, swimvalue, 1) doSetCreatureOutfit(cid, diveroutfit, 60000) if item.actionid == 3333 then player1pos = {x = position.x, y = position.y + 2, z = position.z} player1 = getThingfromPos(player1pos) doTeleportThing(cid, player1pos) doSendMagicEffect(player1pos, CONST_ME_WATERSPLASH) end end if isswimming == 1 then if item.itemid == 4632 then dir = 2 elseif item.itemid == 4633 then dir = 1 elseif item.itemid == 4634 then dir = 1 elseif item.itemid == 4635 then dir = 3 elseif item.itemid == 4636 then dir = 3 elseif item.itemid == 4637 then dir = 1 elseif item.itemid == 4638 then dir = 3 elseif item.itemid == 4639 then dir = 2 elseif item.itemid == 4640 then dir = 3 elseif item.itemid == 4641 then dir = 1 elseif item.itemid == 4642 then dir = 3 elseif item.itemid == 4643 then dir = 1 end doSetCreatureOutfit(cid, standardoutfit, 1) doMoveCreature(cid, dir) setPlayerStorageValue(cid, swimvalue, 2) end end return TRUE end movements.xml <movevent event="StepIn" actionid="3333" script="swimm.lua"/>
Postado Outubro 31, 2012 12 anos Só mudar as Boards códigos ali em baixo de acordo com o id da areia da sua praia que nem todos servidores tem o mesmo id dos script Item.xml marcarei mudando a cor pra você colocar igual do seu server.. TODOS COM ID 4 DIGITOS local outfit = {lookType = 267, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0} local BORDERS = { [7943] = {x = 0, y = -2, back = SOUTH}, [7944] = {x = -2, y = 0, back = EAST}, [7945] = {x = 0, y = 2, back = NORTH}, [7946] = {x = 2, y = 0, back = WEST}, [7947] = {x = 2, y = 1, back = WEST}, [7948] = {x = -2, y = 1, back = NORTH}, [7949] = {x = 2, y = -1, back = WEST}, [7950] = {x = -2, y = -1, back = EAST}, [7951] = {x = 2, y = 2, back = WEST}, [7952] = {x = -2, y = 2, back = NORTH}, [7953] = {x = 2, y = -2, back = WEST}, [7954] = {x = -2, y = -2, back = SOUTH} } BORDERS[4828] = BORDERS[7943] BORDERS[4829] = BORDERS[7946] BORDERS[4830] = BORDERS[7945] BORDERS[4831] = BORDERS[7944] function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if(not isPlayer(cid)) then return true end local border = BORDERS[item.itemid] if(not border) then return false end local pos, newPos = getCreaturePosition(cid), {} newPos = pos newPos.x = pos.x + border.x newPos.y = pos.y + border.y if(hasCondition(cid, CONDITION_OUTFIT) and getCreatureOutfit(cid).lookType == outfit.lookType) then doMoveCreature(cid, border.back) doRemoveCondition(cid, CONDITION_OUTFIT) else if(doTileQueryAdd(cid, pos, 4) ~= RETURNVALUE_NOERROR) then return false end local tmp = getCreaturePosition(cid) doTeleportThing(cid, newPos) if(not isPlayerGhost(cid)) then doSendMagicEffect(tmp, CONST_ME_POFF) doSendMagicEffect(newPos, CONST_ME_WATERSPLASH) end doRemoveConditions(cid, true) doSetCreatureOutfit(cid, outfit, -1) end return true end <!-- Swimming --> <movevent type="StepIn" itemid="4828-4831" event="script" value="swimming.lua"/> <movevent type="StepIn" itemid="7943-7954" event="script" value="swimming.lua"/> <movevent type="StepIn" actionid="5555" event="script" value="onenter.lua"/> <movevent type="StepOut" actionid="12350" event="script" value="WarArenaMovement1.lua"/> <movevent type="StepIn" actionid="12351" event="script" value="WarArenaMovement2.lua"/> <movevent type="StepIn" actionid="12352" event="script" value="WarArenaMovement3.lua"/> <movevent type="StepIn" actionid="2020" event="script" value="changetile.lua"/> <movevent type="StepIn" actionid="2021" event="script" value="changetilee.lua"/> Rep + Não custa nada Nos ajudem divulgar Servidor Em Update http://baiakrevoluci...node.com/radio/ Editado Outubro 31, 2012 12 anos por zamurai (veja o histórico de edições) Meus Trabalhos [Aprendendo] Criar client Próprio Scripts !transform Weblara O Dedicado Que Você Quer Só Aqui . Projeto Bleach server Ajudem. só colocar seu nome o skype eo que você sabe fazer.
Postado Julho 7, 2015 9 anos galera nao entendi estes scripts.. estou com quase o mesmo problema, so q eu n consigo ir pra a agua mesmo com a borda certa.. e tbm quando pego o god e saio com /a ele continua nadando.. mas n consegui entender onde coloca estes scripts ;/
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.