Postado Outubro 26, 2018 6 anos Solução @Brunds esqueci a função main kkk function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1518, y = 1159, z = 15}, --começo da area to = {x = 1534, y = 1174, z = 15}, -- final da area playerDestiny = {x = 1077, y = 783, z = 6} -- para onde o player vai } function onUse(cid, item, frompos, item2, topos) if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end doTeleportThing(cid, config.playerDestiny) doPlayerSendTextMessage(cid, 20, "Boa Sorte!") doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Outubro 26, 2018 6 anos Autor @Vodkart não funcionou vod mesmo tendo jogadores no local ainda teleporta outros ... Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas. discord.gg/phJZeHa2k4 Projeto ATS (Naruto) Informações Abaixo Facebook Youtube Discord Tutoriais / Conteúdos Clique Aqui
Postado Outubro 26, 2018 6 anos 16 minutos atrás, Brunds disse: @Vodkart não funcionou vod mesmo tendo jogadores no local ainda teleporta outros ... me mostra seu codigo [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Outubro 26, 2018 6 anos Autor @Vodkart function onUse(cid, item, frompos, item2, topos) if item.uid == 7001 then if item.itemid == 1945 then player1pos = {x=1076, y=783, z=6, stackpos=253} player2pos = {x=1077, y=783, z=6, stackpos=253} player1 = getThingfromPos(player1pos) player2 = getThingfromPos(player2pos) function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1559, y = 754, z = 7}, --começo da area to = {x = 1216, y = 798, z = 7}, -- final da area playerDestiny = {x = 1071, y = 789, z = 7} -- para onde o player vai } function onUse(cid, item, frompos, item2, topos) if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end doTeleportThing(cid, config.playerDestiny) doPlayerSendTextMessage(cid, 20, "Boa Sorte!") doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end if player1.itemid > 0 and player2.itemid > 0 then player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) questlevel = 420 if player1level >= questlevel and player2level >= questlevel then queststatus1 = getPlayerStorageValue(player1.uid,62800) queststatus2 = getPlayerStorageValue(player2.uid,62800) if queststatus1 == -1 and queststatus2 == -1 then nplayer1pos = {x=1071, y=789, z=7} nplayer2pos = {x=1071, y=788, z=7} doSendMagicEffect(player1pos,2) doSendMagicEffect(player2pos,2) doTeleportThing(player1.uid,nplayer1pos) doTeleportThing(player2.uid,nplayer2pos) doSendMagicEffect(nplayer1pos,10) doSendMagicEffect(nplayer2pos,10) doTransformItem(item.uid,item.itemid+0) else doPlayerSendCancel(cid,"Alguem do seu time já fez essa quest.") end else doPlayerSendCancel(cid,"Alguem não possui level 420 ou mais.") end else doPlayerSendCancel(cid,"Voce não possui membros o suficiente.") end elseif item.itemid == 1946 then if getPlayerAccess(cid) == 0 then doTransformItem(item.uid,item.itemid-1) else doPlayerSendCancel(cid,"Membros da Staff não podem fazer a quest") end end end return 1 end Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas. discord.gg/phJZeHa2k4 Projeto ATS (Naruto) Informações Abaixo Facebook Youtube Discord Tutoriais / Conteúdos Clique Aqui
Postado Outubro 27, 2018 6 anos Autor @Vodkart tentei editar assim mas também não faz a verificação function getPlayersInArea(from, to) local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), from, to) then t[#t+1] = pid end end return t end local config = { limit = 1, -- limite de jogador na area from = {x = 1559, y = 754, z = 7}, --começo da area to = {x = 1216, y = 798, z = 7}, -- final da area } function onUse(cid, item, frompos, item2, topos) if item.uid == 7001 then if item.itemid == 1945 then player1pos = {x=1076, y=783, z=6, stackpos=253} player2pos = {x=1077, y=783, z=6, stackpos=253} player1 = getThingfromPos(player1pos) player2 = getThingfromPos(player2pos) if #getPlayersInArea(config.from, config.to) >= config.limit then doPlayerSendCancel(cid, 'Alguem Ja Esta Na Area.') doSendMagicEffect(getThingPos(cid), 2) return true end if player1.itemid > 0 and player2.itemid > 0 then player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) questlevel = 420 if player1level >= questlevel and player2level >= questlevel then queststatus1 = getPlayerStorageValue(player1.uid,62800) queststatus2 = getPlayerStorageValue(player2.uid,62800) if queststatus1 == -1 and queststatus2 == -1 then nplayer1pos = {x=1071, y=789, z=7} nplayer2pos = {x=1071, y=788, z=7} doSendMagicEffect(player1pos,2) doSendMagicEffect(player2pos,2) doTeleportThing(player1.uid,nplayer1pos) doTeleportThing(player2.uid,nplayer2pos) doSendMagicEffect(nplayer1pos,10) doSendMagicEffect(nplayer2pos,10) doTransformItem(item.uid,item.itemid+0) else doPlayerSendCancel(cid,"Alguem do seu time já fez essa quest.") end else doPlayerSendCancel(cid,"Alguem não possui level 420 ou mais.") end else doPlayerSendCancel(cid,"Voce não possui membros o suficiente.") end elseif item.itemid == 1946 then doTransformItem(item.uid,item.itemid-1) end end return 1 end Compre seus Scripts Agora totalmente seguro e de forma rápida, aceitamos também encomendas. discord.gg/phJZeHa2k4 Projeto ATS (Naruto) Informações Abaixo Facebook Youtube Discord Tutoriais / Conteúdos Clique Aqui
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.