Postado Março 6, 2015 10 anos Exatamente, mas é o seguinte, teria que criar um script pra não poder deslogar usando estes atributos. Fácil de fazer. Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
Postado Março 6, 2015 10 anos Autor Exatamente, mas é o seguinte, teria que criar um script pra não poder deslogar usando estes atributos. Fácil de fazer. Pode Fazer Pra Mim Fazendo Um Favor? MEU SERVER: http://otpokemonxy.net/ Nosso → Grupo Oficial OtPokemon XY 24 Horas Nosso → Site Oficial OtPokemon XY 24 Horas Nossa → Pagina Oficial OtPokemon XY 24 Horas
Postado Março 6, 2015 10 anos Solução O script da bike ficará assim: local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999} local bikeid = 1212 -- ITEMID da Bike local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, t.speed) end local function BikeSpeedOff(cid, t) setPlayerStorageValue(cid, t.s, -1) doRegainSpeed(cid) end function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getThingPos(cid) if getPlayerItemCount(cid, 12774) <= 0 then return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.") end if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then return doPlayerSendCancel(cid, "You can't do that right now.") end if getPlayerStorageValue(cid, t.s) <= 0 then if item.actionid ~= 12120 then doRemoveItem(item.uid, 1) local create_action = doPlayerAddItem(cid, bikeid, 1) doItemSetAttribute(create_action, "aid", 12120) setPlayerStorageValue(cid, 12120, 1) doSendMagicEffect(pos, 177) doCreatureSay(cid, t.text, 19) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.') BikeSpeedOn(cid, t) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 1951}, -1) else doSetCreatureOutfit(cid, {lookType = 1950}, -1) end else doPlayerSendCancel(cid, "This bike is in use.") end else if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 1951 or getCreatureOutfit(cid).lookType == 1950 then doRemoveItem(item.uid, 1) doPlayerAddItem(cid, bikeid, 1) setPlayerStorageValue(cid, 12120, -1) doSendMagicEffect(pos, 177) doCreatureSay(cid, t.dtext, 19) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.') BikeSpeedOff(cid, t) doRemoveCondition(cid, CONDITION_OUTFIT) else doPlayerSendCancel(cid, "This bike isn't yours.") end end return true end Agora em creaturescripts.xml adicione a tag: <event type="logout" name="EventLogout" event="script" value="SystemLogout.lua"/> E em SystemLogout.lua, adicione o script abaixo: function onLogout(cid) if getPlayerStorageValue(cid, 12120) > 0 then return doPlayerSendCancel(cid, "You can't logout while riding in the bike.") and false end return true end Agora em login.lua, adicione a tag abaixo junto com as do gênero: registerCreatureEvent(cid, "EventLogout") Boa sorte. Editado Março 6, 2015 10 anos por Adriano SwaTT (veja o histórico de edições) Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
Postado Março 6, 2015 10 anos Autor O script da bike ficará assim: local t = {text='Mount, bike!', dtext='Demount, bike!', s=5700, speed = 9999} local bikeid = 1212 -- ITEMID da Bike local function BikeSpeedOn(cid, t) setPlayerStorageValue(cid, t.s, t.speed) doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, t.speed) end local function BikeSpeedOff(cid, t) setPlayerStorageValue(cid, t.s, -1) doRegainSpeed(cid) end function onUse(cid, item, fromPosition, itemEx, toPosition) local pos = getThingPos(cid) if getPlayerItemCount(cid, 12774) <= 0 then return doPlayerSendCancel(cid, "Você precisa ter a bike na sua bag.") end if getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 or getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 75846) >= 1 or getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then return doPlayerSendCancel(cid, "You can't do that right now.") end if getPlayerStorageValue(cid, t.s) <= 0 then if item.actionid ~= 12120 then doRemoveItem(item.uid, 1) local create_action = doPlayerAddItem(cid, bikeid, 1) doItemSetAttribute(create_action, "aid", 12120) setPlayerStorageValue(cid, 12120, 1) doSendMagicEffect(pos, 177) doCreatureSay(cid, t.text, 19) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted in a bike.') BikeSpeedOn(cid, t) if getPlayerSex(cid) == 1 then doSetCreatureOutfit(cid, {lookType = 1951}, -1) else doSetCreatureOutfit(cid, {lookType = 1950}, -1) end else doPlayerSendCancel(cid, "This bike is in use.") end else if item.actionid == 12120 and getCreatureOutfit(cid).lookType == 1951 or getCreatureOutfit(cid).lookType == 1950 then doRemoveItem(item.uid, 1) doPlayerAddItem(cid, bikeid, 1) setPlayerStorageValue(cid, 12120, -1) doSendMagicEffect(pos, 177) doCreatureSay(cid, t.dtext, 19) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You haven demouted of a bike.') BikeSpeedOff(cid, t) doRemoveCondition(cid, CONDITION_OUTFIT) else doPlayerSendCancel(cid, "This bike isn't yours.") end end return true end Agora em creaturescripts.xml adicione a tag: <event type="logout" name="EventLogout" event="script" value="SystemLogout.lua"/> E em SystemLogout.lua, adicione o script abaixo: function onLogout(cid) if getPlayerStorageValue(cid, 12120) > 0 then return doPlayerSendCancel(cid, "You can't logout while riding in the bike.") and false end return true end Agora em login.lua, adicione a tag abaixo junto com as do gênero: registerCreatureEvent(cid, "EventLogout") Boa sorte. Ai Amigo Vlw Denovo Fico Perfeito Não Deu Um Bug Sou Seu Fã Namoral Vlw Msm De Verdade Me Ajudou Muito MEU SERVER: http://otpokemonxy.net/ Nosso → Grupo Oficial OtPokemon XY 24 Horas Nosso → Site Oficial OtPokemon XY 24 Horas Nossa → Pagina Oficial OtPokemon XY 24 Horas
Postado Março 6, 2015 10 anos Obrigado, que bom que funcionou. Faça bom proveito e boa sorte com seu projeto. Até breve. Editado Março 14, 2015 10 anos por Adriano SwaTT (veja o histórico de edições) Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
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.