Ir para conteúdo

Featured Replies

Postado

Explicação: Coloquei na script surf para checar se o jogador está montado na bicicleta, fazendo assim com que bloqueie o jogador de surfar se estiver montado.

Problema: Ele checa se o jogador está montado, se estiver, não permite o jogador surfar, porém, mesmo se eu sair da bicicleta ele continua bloqueando(se eu relogar volta ao normal).

ppkmon.png?1517517474

Expectativa: gostaria que quando o jogador desmontasse da bicicleta pudesse surfar sem problemas!

 

local flie = {'4608', '4609', '4610', '4611', '4612', '4613', 
'4614', '4615', '4616', '4617', '4618', '4619', 
'4620', '4621', '4622', '4623', '4624', '4625', 
'4632', '4633', '4634', '4635', '4636', '4637', '4638', '4639', '4640', '4641', '4642', '4643', 
'4644', '4645', '4646', '4647', '4648', '4649', '4650', '4651', '4652', '4653', '4654', '4655', '4656', '4657', '4658', '4659', '4660', '4661', '4662', '4663', 
'4664', '4665', '4666', 
'4820', '4821', '4822', '4823', '4824', '4825', 
'4828', '4829', '4830', '4831', 
'5405', '5406', '5407', '5408', '5409', '5410', 
'5427', '5428', '5429', '5430', '5431', '5432', '5433', '5434', '5435', '5436', '5437', '5438', 
'6627', '6628', '6629', '6630', '6631', '6632', '6633', '6634', '6635', '6636', '6637', '6638', '6639', '6640', '6641', '6642', '6643', '6644', '6645', '6646', '6647', '6648', '6649', '6650', '6651', '6652', '6653', '6654', '6655', '6656', '6657', '6658', '6659', '6660', '6661', '6662', '6663', '6664', '6665', '6666', '6667', '6668', '6669', '6660', '6661', '6662', '6663', '6664', '6665', '6666', '6667', '6668', '6669', 
'6670', '6671', '6672', '6673', '6674', '6675', '6676', '6677', '6678', '6679', '6680', '6681', '6682', 
'6687', '6688', '6689', '6690', '6691', '6692', '6693', '6694', 
'7943', '7944', '7945', '7946', '7947', '7948', '7949', '7950', '7951', '7952', '7953', '7954'}

function onStepIn(cid, item, position, fromPosition)
   
    if not isPlayer(cid) and not isPremium(cid) then -- tire o primeiro not, atras do isPlayer para ativar o premium
        doTeleportThing(cid, fromPosition, false)
        doPlayerSendCancel(cid, "Only premium members are allowed to surf.")
    return true
    end
	
	local pokeballInfo = getPokeballInfo(getPlayerSlotItem(cid, 8).uid)

	if getCreatureOutfit(cid).lookType == 316 then
        doSendMagicEffect(fromPosition, 136)
    end
    
	if not isPlayer(cid) then
        doTeleportThing(cid, fromPosition, false)
    return true
    end

    if getPlayerStorageValue(cid, 63215) ~= 1 and getPlayerStorageValue(cid, 17000) <= 0 then
	    if #getCreatureSummons(cid) == 0 then
	        doPlayerSendCancel(cid, "You need a pokemon to surf.")
	        doTeleportThing(cid, fromPosition, false)
	    else
	        if (not isInArray(Ability['Surf'], pokeballInfo.name)) then
	            doPlayerSendCancel(cid, "This pokemon cannot surf.")
	            doTeleportThing(cid, fromPosition, false)
	        return true
	        end
	    end
    end
	
		    if getPlayerStorageValue(cid, 32001) <= 1 then
	        doPlayerSendCancel(cid, "Dismount to surf.")
	        doTeleportThing(cid, fromPosition, false)
		return true
		end

	if #getCreatureSummons(cid) >= 1 and isInArray(Ability['Surf'], pokeballInfo.name) and getPlayerStorageValue(cid, 63215) ~= 1 and getPlayerStorageValue(cid, 17000) <= 0 then
        doSetCreatureOutfit(cid, surf[pokeballInfo.name], -1)
        doCreatureSay(cid, ""..pokeballInfo.nick..", lets surf!", 1)
        doChangeSpeed(cid, -(getCreatureSpeed(cid)))
        doChangeSpeed(cid, surf[pokeballInfo.name].speed)
        setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1]))
        setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1]))
        doRemoveCreature(getCreatureSummons(cid)[1])
		doPlayerSendCancel(cid, "@H|Hide")
		doPlayerSendCancel(cid, "@M|hide")
        addEvent(setPlayerStorageValue, 100, cid, 63215, 1)
    end

	if getPlayerStorageValue(cid, 63215) == 1 then
        if getCreatureLookDir(cid) == 0 then
            doSendMagicEffect(fromPosition, 33)
        elseif getCreatureLookDir(cid) == 1 then
            doSendMagicEffect(fromPosition, 49)
        elseif getCreatureLookDir(cid) == 2 then
            doSendMagicEffect(fromPosition, 30)
        elseif getCreatureLookDir(cid) == 3 then
            doSendMagicEffect(fromPosition, 51)
        end
    end
	
    if getPlayerStorageValue(cid, 17000) >= 1 then
        if not isInArray(flie, getTileInfo(fromPosition).itemid) then
        return true
        end

	    if getCreatureLookDir(cid) == 0 then
            doSendMagicEffect(fromPosition, 33)
        elseif getCreatureLookDir(cid) == 1 then
            doSendMagicEffect(fromPosition, 49)
        elseif getCreatureLookDir(cid) == 2 then
            doSendMagicEffect(fromPosition, 30)
        elseif getCreatureLookDir(cid) == 3 then
            doSendMagicEffect(fromPosition, 51)
        end
    end
return true
end

function onStepOut(cid, item, position, fromPosition)
if not isInArray({4606, 4607, 4608, 4609, 
44610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 
4620, 4621, 4622, 4623, 4624, 4625, 4632, 4633, 4634, 4635, 4636, 4637, 4638, 4639, 
4640, 4641, 4642, 4643, 4644, 4645, 4646, 4647, 4648, 4649, 
4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 
4660, 4661, 4662, 4663, 4664, 4665, 4666, 
4820, 4821, 4822, 4823, 4824, 4825, 4828, 4829, 4830, 4831, 5405, 5406, 5407, 5408, 5409, 5410, 
5427, 5428, 5429, 5430, 5431, 5432, 5433, 5434, 5435, 5436, 5437, 5438, 
6627, 6628, 6629, 
6630, 6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6639, 
6640, 6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 
6650, 6651, 6652, 6653, 6654, 6655, 6656, 6657, 6658, 6659, 
6660, 6661, 6662, 6663, 6664, 6665, 6666, 6667, 6668, 6669, 
6670, 6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 
6680, 6681, 6682, 6687, 6688, 6689, 6690, 6691, 6692, 6693, 6694, 
7943, 7944, 7945, 7946, 7947, 7948, 7949, 7950, 7951, 7952, 7953, 7954}, getTileThingByPos(getThingPos(cid)).itemid) then
setPlayerGroupId(cid, 1)
end
return true
end

 

Resolvido por PedroSTT

Ir para solução
  • Respostas 13
  • Visualizações 458
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local outfit = 123 -- Id da outfit da bike if getCreatureOutfit(cid) == outfit then doPlayerSendCancel(cid, "Dismount to surf.") doTeleportThing(cid, fromPosition, false) return false end Tenta p

Postado
if not getPlayerStorageValue(cid, 32001) <= 0 then
doPlayerSendCancel(cid, "Dismount to surf.")
doTeleportThing(cid, fromPosition, false)
return true
end

Tenta assim , se não der certo é porque ao sair da bike o player continua com a storage da bike.
 

giphy.gif

Postado
  • Solução
local outfit = 123 -- Id da outfit da bike

if getCreatureOutfit(cid) == outfit then
doPlayerSendCancel(cid, "Dismount to surf.")
doTeleportThing(cid, fromPosition, false)

return false
end

Tenta por pela outfit da bike ... se não der certo tente trocar de return false para return true

giphy.gif

Postado
  • Autor
3 minutos atrás, PedroSTT disse:

local outfit = 123 -- Id da outfit da bike

if getCreatureOutfit(cid) == outfit then
doPlayerSendCancel(cid, "Dismount to surf.")
doTeleportThing(cid, fromPosition, false)

return false
end

Tenta por pela outfit da bike ... se não der certo tente trocar de return false para return true

agora ele entra, porém continua com a storage da bike. Buga na distro!

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo