static void useportal(data generaldata, client.gamestate client) { client.entity.action = khaledmohamed.game.enums.conqueraction.none; client.revivestamp = time32.now; client.attackable = false; ushort portal_x = (ushort)(generaldata.dwparam & 0xffff); ushort portal_y = (ushort)(generaldata.dwparam >> 16); string portal_id = portal_x.tostring() + ":" + portal_y.tostring() + ":" + client.map.id.tostring(); if (client.account.state == database.accounttable.accountstate.projectmanager) client.send(new message("portal id: " + portal_id, system.drawing.color.red, network.gamepackets.message.topleft)); foreach (game.portal portal in client.map.portals) { int newmap = portal.destinationmapid + 1000; if (kernel.getdistance(portal.currentx, portal.currenty, client.entity.x, client.entity.y) <= 4) { if (client.player.servernum == 1) { client.entity.teleport(portal.destinationmapid, portal.destinationx, portal.destinationy, false); return; } else { if(portal.destinationmapid==1002)// client.entity.teleport(1004, portal.destinationx, portal.destinationy, false);// هتاخد سطر ده و الي فوقه كوبي و باست عشان تضيف مابات تانيه // 1002 مابه قديمه الي هتخرج فيها //1004 مابه جديده الي هتخرج فيها طالما انته ف سيرفير تاني if (portal.destinationmapid == 1002) client.entity.teleport(portal.destinationmapid, portal.destinationx, portal.destinationy, false); return; } } } if (client.player.servernum == 1) { client.entity.teleport(1002, 300, 278); } else { client.entity.teleport(1002, 300, 278); //مابه سيرفير تاني } }