Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### Hyperspace! ###]]--
- --[[ ### by H® Shaft ###]]--
- --[[ ### for Phasor v2 ###]]--
- -- enables players to hyperspace jump to random locations by pressing their flashlight key ('q' standard key), in or out of a vehicle
- -- All games: allows broad use of the entire map, not just spawn locations. Hyperspace coordinates are balanced for team games
- -- CTF and Oddball: Make a quick getaway!
- -- Natural danger: sometimes you will hyperspace and die (fall thru map, under vehicles, etc)
- -- edit --
- hyper_limit = 3 --| Number of times a player may hyperspace jump during one life.
- -- don't edit --
- hyperspace_coord = {}
- hyper_calls = {}
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- if game == "PC" then
- GAME = "PC"
- map_name = readstring(0x698F21)
- elseif game == "CE" then
- GAME = "CE"
- map_name = readstring(0x61D151)
- end
- for i=0,15 do
- if getplayer(i) then
- hyper_calls[i] = 0
- end
- end
- LoadCoords()
- end
- function OnNewGame(map)
- if GAME == "PC" then
- map_name = readstring(0x698F21)
- elseif GAME == "CE" then
- map_name = readstring(0x61D151)
- end
- for i=0,15 do
- if getplayer(i) then
- hyper_calls[i] = 0
- end
- end
- LoadCoords()
- end
- function OnClientUpdate(player)
- local m_playerObjId = getplayerobjectid(player)
- if m_playerObjId and isinvehicle(player) then
- local m_vehicleId = getvehicleobjectid(player)
- if getdriverplayer(getobject(m_vehicleId)) == player and readbit(getobject(m_playerObjId) + 0x208, 4) then
- if hyper_calls[player] < hyper_limit then
- OnHyperSpace(m_vehicleId)
- hyper_calls[player] = hyper_calls[player] + 1
- sendconsoletext(player, "Hyperspace! You have " .. hyper_limit - hyper_calls[player] .. " hyperspace jumps remaining.")
- else
- sendconsoletext(player, "You are out of hyperspace jumps for this life.")
- end
- end
- elseif m_playerObjId and not isinvehicle(player) and readbit(getobject(m_playerObjId) + 0x208, 4) then
- if hyper_calls[player] < hyper_limit then
- OnHyperSpace(m_playerObjId)
- hyper_calls[player] = hyper_calls[player] + 1
- sendconsoletext(player, "Hyperspace! You have " .. hyper_limit - hyper_calls[player] .. " hyperspace jumps remaining.")
- else
- sendconsoletext(player, "You are out of hyperspace jumps for this life.")
- end
- end
- end
- function OnHyperSpace(m_objectId)
- local coord = SelectHyperCoord()
- if coord then
- movobjectcoords(m_objectId, hyperspace_coord[coord][1], hyperspace_coord[coord][2], hyperspace_coord[coord][3])
- end
- end
- function SelectHyperCoord(arg)
- local hypercount = #hyperspace_coord
- if hypercount > 0 then
- return getrandomnumber(1, hypercount+1)
- end
- return nil
- end
- function OnPlayerKill(killer, victim, mode)
- if getplayer(victim) then
- hyper_calls[victim] = 0
- end
- end
- function getvehicleobjectid(player)
- local m_objectId = getplayerobjectid(player)
- if m_objectId then return readdword(getobject(m_objectId) + 0x11C) end
- end
- function getdriverplayer(m_vehicle)
- local m_objectId = readdword(m_vehicle + 0x324)
- if m_objectId ~= 0xFFFFFFFF then return objectidtoplayer(m_objectId) end
- end
- function OnVehicleEntry(player, veh_id, seat, mapid, relevant)
- if seat == 0 then
- privatesay(player, "Driver: Press Flashlight Button to activate Hyperspace jump.")
- end
- return nil
- end
- function OnPlayerJoin(player)
- if getplayer(player) then
- hyper_calls[player] = 0
- sendconsoletext(player, "Press Flashlight Button to activate Hyperspace jump.", 6, 0)
- end
- end
- function OnServerChat(player, type, message)
- local response = nil
- -- use to add your own coordinates: type 'coord' to retrieve your xyz coordinates
- -- returns your coordinates in or out of vehicle: x, y, z
- if string.lower(message) == "coord" then
- local m_playerObjId = getplayerobjectid(player)
- if m_playerObjId then
- if isinvehicle(player) then
- local m_vehicleId = readdword(getobject(m_playerObjId) + 0x11C)
- m_objectId = m_vehicleId
- elseif m_playerObjId then
- m_objectId = m_playerObjId
- end
- if m_objectId then
- local x,y,z = getobjectcoords(m_objectId)
- sendconsoletext(player, "X: " .. x .. " Y: " .. y .. " Z: " .. z, 15, 0)
- end
- end
- response = true
- end
- return response
- end
- function LoadCoords()
- if map_name == "bloodgulch" then
- hyperspace_coord[1] = {27.765, -68.956, 0.814}
- hyperspace_coord[2] = {78.675, -65.064, 5.124}
- hyperspace_coord[3] = {71.056, -87.134, 5.934}
- hyperspace_coord[4] = {24.034, -108.528, 2.814}
- hyperspace_coord[5] = {68.872, -94.818, 1.934}
- hyperspace_coord[6] = {95.161, -90.663, 5.414}
- hyperspace_coord[7] = {104.015, -108.722, 2.014}
- hyperspace_coord[8] = {99.938, -112.221, 4.484}
- hyperspace_coord[9] = {75.196, -132.243, 0.224}
- hyperspace_coord[10] = {46.746, -150.693, 4.664}
- hyperspace_coord[11] = {62.088, -155.783, 6.094}
- hyperspace_coord[12] = {115.724, -127.820, 1.904}
- hyperspace_coord[13] = {125.209, -180.481, 6.514}
- hyperspace_coord[14] = {78.985, -179.657, 1.854}
- hyperspace_coord[15] = {58.753, -123.087, 0.554}
- elseif map_name == "dangercanyon" then
- hyperspace_coord[1] = {34.736, -7.265, -0.776}
- hyperspace_coord[2] = {51.490, 29.940, -9.556}
- hyperspace_coord[3] = {27.078, 26.459, 0.454}
- hyperspace_coord[4] = {21.222, 53.724, -8.886}
- hyperspace_coord[5] = {4.750, 36.134, -7.886}
- hyperspace_coord[6] = {-4.682, 47.397, -7.886}
- hyperspace_coord[7] = {-26.567, 46.216, -9.516}
- hyperspace_coord[8] = {-26.740, 26.168, 0.424}
- hyperspace_coord[9] = {-58.930, 19.913, -9.046}
- hyperspace_coord[10] = {-35.574, -7.524, -0.826}
- hyperspace_coord[11] = {-0.095, 16.004, -0.480}
- hyperspace_coord[12] = {-16.163, 20.354, 0.480}
- hyperspace_coord[13] = {16.305, 20.547, 0.480}
- hyperspace_coord[14] = {4.931, 33.303, 0.480}
- hyperspace_coord[15] = {-4.972, 33.261, 0.480}
- hyperspace_coord[16] = {-5.517, 54.629, 0.710}
- hyperspace_coord[17] = {5.023, 55.362, 0.710}
- elseif map_name == "deathisland" then
- hyperspace_coord[1] = {-33.178, -24.972, 10.068}
- hyperspace_coord[2] = {-37.525, 21.940, 15.068}
- hyperspace_coord[3] = {-75.184, 18.807, 2.218}
- hyperspace_coord[4] = {-68.700, 19.106, 15.638}
- hyperspace_coord[5] = {-30.180, 53.309, 11.168}
- hyperspace_coord[6] = {-18.347, 35.498, 15.138}
- hyperspace_coord[7] = {15.143, 44.042, 4.318}
- hyperspace_coord[8] = {8.737, 28.474, 10.558}
- hyperspace_coord[9] = {5.428, 10.959, 12.518}
- hyperspace_coord[10] = {-28.905, 9.967, 23.038}
- hyperspace_coord[11] = {-22.920, -28.805, 20.398}
- hyperspace_coord[12] = {11.705, -20.327, 18.938}
- hyperspace_coord[13] = {4.943, -28.034, 3.628}
- hyperspace_coord[14] = {-23.681, -41.145, 8.318}
- hyperspace_coord[15] = {43.185, -41.258, 2.678}
- hyperspace_coord[16] = {43.238, -36.708, 13.958}
- hyperspace_coord[17] = {35.804, -1.491, 9.388}
- hyperspace_coord[18] = {33.087, 33.355, 7.898}
- hyperspace_coord[19] = {18.616, 30.431, 18.388}
- hyperspace_coord[20] = {8.155, -2.428, 20.878}
- hyperspace_coord[21] = {40.705, 45.331, 3.418}
- hyperspace_coord[22] = {34.775, 17.417, 5.378}
- hyperspace_coord[23] = {-69.873, 12.690, 2.268}
- hyperspace_coord[24] = {-29.030, -7.034, 5.938}
- elseif map_name == "icefields" then
- hyperspace_coord[1] = {22.750, 9.500, 1.3}
- hyperspace_coord[2] = {-0.625, -0.458, 2.925}
- hyperspace_coord[3] = {-22.699, 15.685, 9.275}
- hyperspace_coord[4] = {-29.200, 49.053, 9.135}
- hyperspace_coord[5] = {-52.994, 65.216, 2.705}
- hyperspace_coord[6] = {-77.914, 54.044, 1.3}
- hyperspace_coord[7] = {-45.024, 28.381, 1.3}
- hyperspace_coord[8] = {-5.641, 36.686, 1.3}
- elseif map_name == "gephyrophobia" then
- hyperspace_coord[1] = {68.81, -110.08, -0.184}
- hyperspace_coord[2] = {64.28, -74.03, -0.184}
- hyperspace_coord[3] = {68.95, -39.61, -0.184}
- hyperspace_coord[4] = {-19.89, -32.06, -0.184}
- hyperspace_coord[5] = {-21.19, -78.55, -0.184}
- hyperspace_coord[6] = {-21.34, -106.19, -0.184}
- hyperspace_coord[7] = {39.549, -69.047, -12.195}
- hyperspace_coord[8] = {14.079, -74.159, -12.195}
- hyperspace_coord[9] = {26.886, -72.053, 11.405}
- hyperspace_coord[10] = {23.062, -40.741, -17.845}
- hyperspace_coord[11] = {30.367, -105.614, -17.845}
- hyperspace_coord[12] = {26.840, -72.365, -16.675}
- elseif map_name == "infinity" then
- hyperspace_coord[1] = {0.728, -165.882, 13.411}
- hyperspace_coord[2] = {49.620, -138.104, 15.361}
- hyperspace_coord[3] = {-42.124, -118.236, 14.071}
- hyperspace_coord[4] = {-20.727, -63.191, 12.821}
- hyperspace_coord[5] = {27.663, -66.958, 11.601}
- hyperspace_coord[6] = {55.543, -0.009, 10.051}
- hyperspace_coord[7] = {-1.968, 49.324, 10.121}
- hyperspace_coord[8] = {-51.869, 4.706, 11.761}
- hyperspace_coord[9] = {3.624, -41.338, 27.761}
- hyperspace_coord[10] = {2.766, -84.036, 27.641}
- hyperspace_coord[11] = {-0.536, -78.371, 13.781}
- hyperspace_coord[12] = {22.859, -45.771, 14.38}
- elseif map_name == "sidewinder" then
- hyperspace_coord[1] = {-32.938, -13.044, -0.721}
- hyperspace_coord[2] = {33.985, -12.170, -1.581}
- hyperspace_coord[3] = {-0.321, 25.175, -3.651}
- hyperspace_coord[4] = {-35.259, 10.442, -3.251}
- hyperspace_coord[5] = {40.533, 11.924, -3.641}
- hyperspace_coord[6] = {10.084, -12.067, 0.509}
- hyperspace_coord[7] = {-4.426, -11.080, 0.509}
- hyperspace_coord[8] = {-45.192, 39.458, 0.349}
- hyperspace_coord[9] = {46.377, 39.846, 0.349}
- elseif map_name == "timberland" then
- hyperspace_coord[1] = {-38.672, 33.566, -19.331}
- hyperspace_coord[2] = {32.380, 31.987, -20.941}
- hyperspace_coord[3] = {25.598, 13.687, -20.681}
- hyperspace_coord[4] = {-17.864, 12.050, -20.441}
- hyperspace_coord[5] = {-24.920, -12.816, -20.441}
- hyperspace_coord[6] = {21.240, -9.139, -20.671}
- hyperspace_coord[7] = {39.357, -34.002, -19.341}
- hyperspace_coord[8] = {-28.002, -30.099, -19.831}
- hyperspace_coord[9] = {3.732, -15.392, -21.501}
- hyperspace_coord[10] = {1.619, 16.556, -21.501}
- elseif map_name == "beavercreek" then -- battle creek
- hyperspace_coord[1] = {16.984, 19.294, 5.364}
- hyperspace_coord[2] = {10.970, 21.504, 3.104}
- hyperspace_coord[3] = {6.433, 17.221, 3.224}
- hyperspace_coord[4] = {6.429, 10.395, 3.224}
- hyperspace_coord[5] = {-0.528, 18.334, -0.046}
- hyperspace_coord[6] = {3.401, 9.412, -0.046}
- hyperspace_coord[7] = {17.798, 5.751, 3.744}
- hyperspace_coord[8] = {13.403, 6.129, 5.014}
- hyperspace_coord[9] = {22.597, 16.795, 2.244}
- hyperspace_coord[10] = {22.852, 10.768, 2.244}
- hyperspace_coord[11] = {28.746, 8.869, -0.016}
- hyperspace_coord[12] = {24.236, 18.087, -0.016}
- hyperspace_coord[13] = {13.967, 14.560, -0.246}
- elseif map_name == "boardingaction" then
- hyperspace_coord[1] = {18.010, 19.843, 5.471}
- hyperspace_coord[2] = {20.968, -10.919, 5.471}
- hyperspace_coord[3] = {21.019, -3.501, 3.081}
- hyperspace_coord[4] = {17.766, 14.506, 3.081}
- hyperspace_coord[5] = {18.928, 18.882, -2.009}
- hyperspace_coord[6] = {16.315, 0.910, -2.009}
- hyperspace_coord[7] = {20.069, -19.093, -2.009}
- hyperspace_coord[8] = {1.412, -19.032, -2.009}
- hyperspace_coord[9] = {3.289, -0.977, -2.009}
- hyperspace_coord[10] = {2.671, 16.779, -4.509}
- hyperspace_coord[11] = {3.108, -13.714, -4.509}
- hyperspace_coord[12] = {0.086, -10.078, 0.431}
- hyperspace_coord[13] = {0.553, 14.843, 0.431}
- hyperspace_coord[14] = {0.218, 18.366, 2.951}
- hyperspace_coord[15] = {0.518, -14.468, 2.951}
- hyperspace_coord[16] = {1.560, -19.892, 5.401}
- hyperspace_coord[17] = {-1.495, 11.778, 5.401}
- elseif map_name == "carousel" then -- derelict
- hyperspace_coord[1] = {0.045, 0.460, -0.575}
- hyperspace_coord[2] = {9.145, 0.269, -0.575}
- hyperspace_coord[3] = {0.048, -8.718, -0.575}
- hyperspace_coord[4] = {-9.010, -0.065, -0.575}
- hyperspace_coord[5] = {-0.024, 8.831, -0.575}
- hyperspace_coord[6] = {13.755, 5.636, -0.575}
- hyperspace_coord[7] = {-13.835, -5.731, -0.575}
- hyperspace_coord[8] = {0.012, -0.063, -2.395}
- hyperspace_coord[9] = {0.009, -5.978, -2.395}
- hyperspace_coord[10] = {5.951, -0.144, -2.395}
- hyperspace_coord[11] = {0.055, 6.002, -2.395}
- hyperspace_coord[12] = {-5.774, 0.020, -2.395}
- hyperspace_coord[13] = {1.694, 13.831, -3.255}
- hyperspace_coord[14] = {-1.822, -13.972, -3.255}
- elseif map_name == "chillout" then
- hyperspace_coord[1] = {1.512, 10.120, 0.861}
- hyperspace_coord[2] = {-1.749, 11.100, 4.301}
- hyperspace_coord[3] = {5.190, 12.174, 2.241}
- hyperspace_coord[4] = {5.051, 7.015, 3.681}
- hyperspace_coord[5] = {1.508, 4.784, 3.291}
- hyperspace_coord[6] = {3.651, -0.384, 2.531}
- hyperspace_coord[7] = {-0.944, -0.475, 2.901}
- hyperspace_coord[8] = {1.463, -1.988, 0.111}
- hyperspace_coord[9] = {9.715, 0.897, 0.111}
- hyperspace_coord[10] = {8.550, 10.841, 0.111}
- hyperspace_coord[11] = {-6.089, 1.016, 0.111}
- hyperspace_coord[12] = {-9.279, 0.963, 1.781}
- hyperspace_coord[13] = {-7.982, 6.448, 0.301}
- hyperspace_coord[14] = {11.075, 3.795, 3.656}
- hyperspace_coord[15] = {8.558, 1.047, 2.546}
- elseif map_name == "damnation" then
- hyperspace_coord[1] = {3.606, 7.521, 3.521}
- hyperspace_coord[2] = {-7.431, 7.966, 3.521}
- hyperspace_coord[3] = {-9.837, 1.488, -0.069}
- hyperspace_coord[4] = {-1.893, -1.537, -0.069}
- hyperspace_coord[5] = {2.431, 1.635, 0.171}
- hyperspace_coord[6] = {-6.946, -6.078, 0.011}
- hyperspace_coord[7] = {-5.797, -7.364, 3.591}
- hyperspace_coord[8] = {5.887, 2.985, 3.591}
- hyperspace_coord[9] = {1.126, -5.936, 3.591}
- hyperspace_coord[10] = {7.188, -9.800, 4.611}
- hyperspace_coord[11] = {9.843, -5.068, 6.821}
- hyperspace_coord[12] = {-0.717, -0.966, 8.341}
- hyperspace_coord[13] = {-6.386, 11.847, 3.531}
- hyperspace_coord[14] = {1.300, 13.085, 1.471}
- elseif map_name == "hangemhigh" then
- hyperspace_coord[1] = {16.02, -7.17, -3.46}
- hyperspace_coord[2] = {21.04, -1.80, -4.40}
- hyperspace_coord[3] = {34.57, -5.06, -5.58}
- hyperspace_coord[4] = {29.01, -16.60, -5.58}
- hyperspace_coord[5] = {15.63, -18.05, -5.58}
- hyperspace_coord[6] = {7.12, -21.80, -7.95}
- hyperspace_coord[7] = {21.56, -2.44, -9.25}
- hyperspace_coord[7] = {31.54, 11.73, -7.95}
- hyperspace_coord[7] = {34.85, 14.85, -5.13}
- elseif map_name == "longest" then
- hyperspace_coord[1] = {-6.813, -9.464, 2.151}
- hyperspace_coord[2] = {2.110, -10.611, 2.151}
- hyperspace_coord[3] = {4.885, -19.451, 2.151}
- hyperspace_coord[4] = {-3.831, -18.137, 2.151}
- hyperspace_coord[5] = {-15.149, -10.811, 0.161}
- hyperspace_coord[6] = {13.305, -18.204, 0.161}
- elseif map_name == "prisoner" then
- hyperspace_coord[1] = {-11.247, 3.474, 1.513}
- hyperspace_coord[2] = {3.645, 4.985, 1.513}
- hyperspace_coord[3] = {-9.275, 3.999, 3.363}
- hyperspace_coord[4] = {9.139, -3.615, 3.363}
- hyperspace_coord[5] = {-1.508, -0.147, 1.493}
- hyperspace_coord[6] = {10.011, 3.252, -0.237}
- hyperspace_coord[7] = {-9.109, 3.958, -0.237}
- elseif map_name == "putput" then -- chiron tl34
- hyperspace_coord[1] = {33.424, -9.752, 1.503}
- hyperspace_coord[2] = {-3.036, -5.018, 0.833}
- hyperspace_coord[3] = {-3.162, -34.607, 3.573}
- hyperspace_coord[4] = {13.607, -31.400, 2.923}
- hyperspace_coord[5] = {14.796, -20.330, 0.293}
- elseif map_name == "ratrace" then
- hyperspace_coord[1] = {6.930, 2.812, -0.333}
- hyperspace_coord[2] = {-7.843, -14.639, -2.013}
- hyperspace_coord[3] = {20.718, 0.094, -1.963}
- hyperspace_coord[4] = {2.537, -24.147, -3.453}
- hyperspace_coord[5] = {11.573, -11.296, 0.357}
- hyperspace_coord[6] = {-3.391, -13.534, 0.357}
- hyperspace_coord[7] = {16.691, -19.692, -1.003}
- elseif map_name == "wizard" then
- hyperspace_coord[1] = {4.586, -5.058, -4.2}
- hyperspace_coord[2] = {5.155, 4.820, -4.2}
- hyperspace_coord[3] = {-4.733, 5.064, -4.2}
- hyperspace_coord[4] = {-4.794, -4.913, -4.2}
- hyperspace_coord[5] = {-9.209, -9.249, -2.3}
- hyperspace_coord[6] = {9.270, 9.235, -2.3}
- end
- end
- -- Start sendconsoletext overloaded by Nugget
- console = {}
- console.__index = console
- consoletimer = registertimer(100, "ConsoleTimer")
- phasor_sendconsoletext = sendconsoletext
- function sendconsoletext(player, message, time, order, align, height, func)
- if player then
- console[player] = console[player] or {}
- local temp = {}
- temp.player = player
- temp.id = nextid(player, order)
- temp.message = message or ""
- temp.time = time or 0.7
- temp.remain = temp.time
- temp.align = align or "left"
- temp.height = height or 0
- if type(func) == "function" then
- temp.func = func
- elseif type(func) == "string" then
- temp.func = _G[func]
- end
- console[player][temp.id] = temp
- setmetatable(console[player][temp.id], console)
- return console[player][temp.id]
- end
- end
- function nextid(player, order)
- if not order then
- local x = 0
- for k,v in pairs(console[player]) do
- if k > x + 1 then
- return x + 1
- end
- x = x + 1
- end
- return x + 1
- else
- local original = order
- while console[player][order] do
- order = order + 0.001
- if order == original + 0.999 then break end
- end
- return order
- end
- end
- function getmessage(player, order)
- if console[player] then
- if order then
- return console[player][order]
- end
- end
- end
- function getmessages(player)
- return console[player]
- end
- function getmessageblock(player, order)
- local temp = {}
- for k,v in opairs(console[player]) do
- if k >= order and k < order + 1 then
- table.insert(temp, console[player][k])
- end
- end
- return temp
- end
- function console:getmessage()
- return self.message
- end
- function console:append(message, reset)
- if console[self.player] then
- if console[self.player][self.id] then
- if getplayer(self.player) then
- if reset then
- if reset == true then
- console[self.player][self.id].remain = console[self.player][self.id].time
- elseif tonumber(reset) then
- console[self.player][self.id].time = tonumber(reset)
- console[self.player][self.id].remain = tonumber(reset)
- end
- end
- console[self.player][self.id].message = message or ""
- return true
- end
- end
- end
- end
- function console:shift(order)
- local temp = console[self.player][self.id]
- console[self.player][self.id] = console[self.player][order]
- console[self.player][order] = temp
- end
- function console:pause(time)
- console[self.player][self.id].pausetime = time or 5
- end
- function console:delete()
- console[self.player][self.id] = nil
- end
- function ConsoleTimer(id, count)
- for i,_ in opairs(console) do
- if tonumber(i) then
- if getplayer(i) then
- for k,v in opairs(console[i]) do
- if console[i][k].pausetime then
- console[i][k].pausetime = console[i][k].pausetime - 0.1
- if console[i][k].pausetime <= 0 then
- console[i][k].pausetime = nil
- end
- else
- if console[i][k].func then
- if not console[i][k].func(i) then
- console[i][k] = nil
- end
- end
- if console[i][k] then
- console[i][k].remain = console[i][k].remain - 0.1
- if console[i][k].remain <= 0 then
- console[i][k] = nil
- end
- end
- end
- end
- if table.len(console[i]) > 0 then
- local paused = 0
- for k,v in pairs(console[i]) do
- if console[i][k].pausetime then
- paused = paused + 1
- end
- end
- if paused < table.len(console[i]) then
- local str = ""
- for i = 0,30 do
- str = str .. " \n"
- end
- phasor_sendconsoletext(i, str)
- for k,v in opairs(console[i]) do
- if not console[i][k].pausetime then
- if console[i][k].align == "right" or console[i][k].align == "center" then
- phasor_sendconsoletext(i, consolecenter(string.sub(console[i][k].message, 1, 78)))
- else
- phasor_sendconsoletext(i, string.sub(console[i][k].message, 1, 78))
- end
- end
- end
- end
- end
- else
- console[i] = nil
- end
- end
- end
- return true
- end
- function consolecenter(text)
- if text then
- local len = string.len(text)
- for i = len + 1, 78 do
- text = " " .. text
- end
- return text
- end
- end
- function opairs(t)
- local keys = {}
- for k,v in pairs(t) do
- table.insert(keys, k)
- end
- table.sort(keys,
- function(a,b)
- if type(a) == "number" and type(b) == "number" then
- return a < b
- end
- an = string.lower(tostring(a))
- bn = string.lower(tostring(b))
- if an ~= bn then
- return an < bn
- else
- return tostring(a) < tostring(b)
- end
- end)
- local count = 1
- return function()
- if table.unpack(keys) then
- local key = keys[count]
- local value = t[key]
- count = count + 1
- return key,value
- end
- end
- end
- function table.len(t)
- local count = 0
- for k,v in pairs(t) do
- count = count + 1
- end
- return count
- end
- -- Stop sendconsoletext overloaded
- -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
- -- Visit http://halorace.org/forum/index.php?topic=514.0 or
- -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement