Postado Novembro 4, 2020 4 anos Queria Pedir Um Script De Anti Mc Para Piso No caso o script funcionaria da seguinte maneira: o meu server tem um sistema de castle e nesse castle toda a area dele tem PvP para q os players que morrerem lá dentro não morram literalmente eu gostaria de pedir um script que fizesse o seguinte checasse o ip do player e nisso não deixasse outro com o msm ip passar até o outro ter morrido lembrando que ele n iria ter morrido literalmente e como tem gente que tem irmão que joga etc... eu gostaria de pedir tbm uma contagem no caso eu gostaria de pedir que só pudessem passar 2 players com o mesmo ip eu nao sei direito porem recordo que alguns storages como exausted de algumas magias e muted são excluidos após morrer na area PVP se voces fizerem esse check de ip no caso fazendo o player ganhar algum storage para saber se o outro ja morreu ou não acho que facilitaria
Postado Novembro 7, 2020 4 anos Spoiler local ips = {} function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end local player_ip = getPlayerIp(cid) if table.count(ips, player_ip) == 2 then doPlayerSendTextMessage(cid, 27, "There is already two players with the same IP as yours in the event.") doTeleportThing(cid, fromPosition) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Welcome to the event area.") table.insert(ips, player_ip) return true end Ou: Spoiler function onStepIn(cid, item, position, fromPosition) local list = {} local ips = {} local players = getPlayersOnline() for i, pid in ipairs(players) do local ip = getPlayerIp(pid) local tmp = table.find(ips, ip) if(tmp ~= nil) then if(table.countElements(list, ip) == 0) then list[players[tmp]] = ip end list[pid] = ip end table.insert(ips, ip) end local db = db.getResult("SELECT `name` FROM `event_mcblock`;") local ret = "" if(db:getID() ~= -1) then repeat name = result:getDataString("name") if name == getPlayerName(cid) then ret = true end until not db:next() db:free() end if(table.maxn(list) > 0) then for pid, ip in pairs(list) do if getPlayerIp(cid) == ip then if ret == "" then doTeleportThing(cid,fromPosition,true) doPlayerPopupFYI(cid, ' Alert: Events allow one player per IP \nDuplicate IP found for: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'. Please close multi-client.') else doPlayerPopupFYI(cid,' You are currently sharing an IP adress with another player online!\n You have been given the privilege to pass, If abused this privilege will be revoked.') end return true end end end return true end Xml <movevent type="StepIn" uniqueid="2102" event="script" value="multi_block.lua"/> Isso em movements/script
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.