--[[ ### Leap-Frog v5 ###]]-- --[[ ### by H® Shaft, AelitePrime ###]]-- --[[ ### for Phasor v2 ###]]-- -- PC and CE version 5 3/1/2014 -- Enables drivers to leap hogs into the air by pressing the space bar/jump key and - also, -- enables walking players to jump a bit higher to be able to jump over hogs coming at them. -- do not touch -- enable_vehicle_leap = {} enable_player_leap = {} player_velocity = {} pause_time_players = {} pause_time_vehicles = {} vehicle_velocity = {} emergency_brake = {} brakes = {} jumps = {} pos_multiplier = 0.9 neg_multiplier = -0.09 brk_multiplier = 0.05 -- edit below as you see fit -- -- If the boolean is true for the map then leap-frog for vehicles will be enabled for the map -- Map: Boolean: enable_vehicle_leap. beavercreek = false -- battle creek enable_vehicle_leap. bloodgulch = true enable_vehicle_leap. boardingaction = true enable_vehicle_leap. carousel = false -- derelict enable_vehicle_leap. chillout = false enable_vehicle_leap. damnation = false enable_vehicle_leap. dangercanyon = true enable_vehicle_leap. deathisland = true enable_vehicle_leap. gephyrophobia = true enable_vehicle_leap. hangemhigh = false enable_vehicle_leap. icefields = true enable_vehicle_leap. infinity = true enable_vehicle_leap. longest = false enable_vehicle_leap. prisoner = false enable_vehicle_leap. putput = false -- chiron tl34 enable_vehicle_leap. ratrace = false enable_vehicle_leap. sidewinder = true enable_vehicle_leap. timberland = true enable_vehicle_leap. wizard = false -- If the boolean is true for the map then leap-frog for players will be enabled for the map -- Map: Boolean: enable_player_leap. beavercreek = false -- battle creek enable_player_leap. bloodgulch = false enable_player_leap. boardingaction = false enable_player_leap. carousel = false -- derelict enable_player_leap. chillout = false enable_player_leap. damnation = false enable_player_leap. dangercanyon = false enable_player_leap. deathisland = false enable_player_leap. gephyrophobia = false enable_player_leap. hangemhigh = false enable_player_leap. icefields = false enable_player_leap. infinity = false enable_player_leap. longest = false enable_player_leap. prisoner = false enable_player_leap. putput = false -- chiron tl34 enable_player_leap. ratrace = false enable_player_leap. sidewinder = false enable_player_leap. timberland = false enable_player_leap. wizard = false -- Specify the velocity that you want leap-frog to go at for vehicles -- Map: Velocity: vehicle_velocity. beavercreek = 0 -- battle creek vehicle_velocity. bloodgulch = 1.85 vehicle_velocity. boardingaction = 0 vehicle_velocity. carousel = 0 -- derelict vehicle_velocity. chillout = 0 vehicle_velocity. damnation = 0 vehicle_velocity. dangercanyon = 1.65 vehicle_velocity. deathisland = 1.8 vehicle_velocity. gephyrophobia = 1.9 vehicle_velocity. hangemhigh = 0 vehicle_velocity. icefields = 1.8 vehicle_velocity. infinity = 1.85 vehicle_velocity. longest = 0 vehicle_velocity. prisoner = 0 vehicle_velocity. putput = 0 -- chiron tl34 vehicle_velocity. ratrace = 0 vehicle_velocity. sidewinder = 2.2 vehicle_velocity. timberland = 1.8 vehicle_velocity. wizard = 0 -- Specify the velocity that you want leap-frog to go at for players -- Map: Velocity: player_velocity. beavercreek = 1.5 -- battle creek player_velocity. bloodgulch = 1.5 player_velocity. boardingaction = 1.5 player_velocity. carousel = 1.5 -- derelict player_velocity. chillout = 1.5 player_velocity. damnation = 1.5 player_velocity. dangercanyon = 1.5 player_velocity. deathisland = 1.5 player_velocity. gephyrophobia = 1.5 player_velocity. hangemhigh = 1.5 player_velocity. icefields = 1.5 player_velocity. infinity = 1.5 player_velocity. longest = 1.5 player_velocity. prisoner = 1.5 player_velocity. putput = 1.5 -- chiron tl34 player_velocity. ratrace = 1.5 player_velocity. sidewinder = 1.5 player_velocity. timberland = 1.5 player_velocity. wizard = 1.5 -- Specify the amount of time between leap-frogs for players -- Map: Time(In Seconds): pause_time_players. beavercreek = 4 -- battle creek pause_time_players. bloodgulch = 4 pause_time_players. boardingaction = 2.5 pause_time_players. carousel = 2.5 -- derelict pause_time_players. chillout = 2.5 pause_time_players. damnation = 2.5 pause_time_players. dangercanyon = 4 pause_time_players. deathisland = 4 pause_time_players. gephyrophobia = 4 pause_time_players. hangemhigh = 2.5 pause_time_players. icefields = 4 pause_time_players. infinity = 4 pause_time_players. longest = 2.5 pause_time_players. prisoner = 2.5 pause_time_players. putput = 2.5 -- chiron tl34 pause_time_players. ratrace = 2.5 pause_time_players. sidewinder = 4 pause_time_players. timberland = 4 pause_time_players. wizard = 2.5 -- Specify the amount of time between leap-frogs for vehicles -- Map: Time(In Seconds): pause_time_vehicles. beavercreek = 4 -- battle creek pause_time_vehicles. bloodgulch = 4 pause_time_vehicles. boardingaction = 4 pause_time_vehicles. carousel = 4 -- derelict pause_time_vehicles. chillout = 4 pause_time_vehicles. damnation = 4 pause_time_vehicles. dangercanyon = 4 pause_time_vehicles. deathisland = 4 pause_time_vehicles. gephyrophobia = 4 pause_time_vehicles. hangemhigh = 4 pause_time_vehicles. icefields = 4 pause_time_vehicles. infinity = 4 pause_time_vehicles. longest = 4 pause_time_vehicles. prisoner = 4 pause_time_vehicles. putput = 4 -- chiron tl34 pause_time_vehicles. ratrace = 4 pause_time_vehicles. sidewinder = 4 pause_time_vehicles. timberland = 4 pause_time_vehicles. wizard = 4 -- If this is set to true then If the driver clicks their crouch key the vehicle will come to a complete stop. -- Map: Boolean: emergency_brake. beavercreek = false -- battle creek emergency_brake. bloodgulch = true emergency_brake. boardingaction = false emergency_brake. carousel = false -- derelict emergency_brake. chillout = false emergency_brake. damnation = false emergency_brake. dangercanyon = true emergency_brake. deathisland = true emergency_brake. gephyrophobia = true emergency_brake. hangemhigh = false emergency_brake. icefields = true emergency_brake. infinity = true emergency_brake. longest = false emergency_brake. prisoner = false emergency_brake. putput = false -- chiron tl34 emergency_brake. ratrace = false emergency_brake. sidewinder = true emergency_brake. timberland = true emergency_brake. wizard = false function GetRequiredVersion() return 200 end function OnScriptLoad(process, game, persistent) if game == "PC" then GAME = "PC" Map = readstring(0x698F21) else GAME = "CE" Map = readstring(0x61D151) end for i=0,15 do if getplayer(i) then brakes[i] = 0 jumps[i] = 0 end end end function OnNewGame(map) if GAME == "PC" then Map = readstring(0x698F21) else Map = readstring(0x61D151) end for i=0,15 do if getplayer(i) then brakes[i] = 0 jumps[i] = 0 end end end function OnPlayerJoin(player) if getplayer(player) then brakes[player] = 0 jumps[player] = 0 announce = registertimer(6000, "timedannounce", player) end end function OnGameEnd(stage) if stage == 1 then if announce then removetimer(announce) announce = nil end end end function OnClientUpdate(player) if brakes[player] > 0 then brakes[player] = brakes[player] - 1 end if jumps[player] > 0 then jumps[player] = jumps[player] - 1 end local m_playerObjId = getplayerobjectid(player) if m_playerObjId then local m_object = getobject(m_playerObjId) if isinvehicle(player) then if enable_vehicle_leap[Map] then local m_vehicle = getobject(getplayervehicleid(player)) if brakes[player] == 0 and getdriverplayer(m_vehicle) == player and readbit(m_object + 0x208, 1) then sendconsoletext(player, "Leap Frog!") brakes[player] = math.floor(pause_time_vehicles[Map]*30) writebit(m_vehicle + 0x10, 5, 0) writefloat(m_vehicle + 0x70, vehicle_velocity[Map]/10) if readfloat(m_vehicle, 0x8C) > 0 then writefloat(m_vehicle + 0x8C, readfloat(m_vehicle, 0x8C)*neg_multiplier) else writefloat(m_vehicle + 0x8C, readfloat(m_vehicle, 0x8C)*pos_multiplier) end writefloat(m_vehicle + 0x90, readfloat(m_vehicle, 0x90)*pos_multiplier) writefloat(m_vehicle + 0x94, readfloat(m_vehicle, 0x94)*pos_multiplier) end end if emergency_brake[Map] then local m_vehicle = getobject(getplayervehicleid(player)) if getdriverplayer(m_vehicle) == player and readbit(m_object + 0x208, 0) then writefloat(m_vehicle + 0x68, readfloat(m_vehicle + 0x68)*brk_multiplier) writefloat(m_vehicle + 0x6C, readfloat(m_vehicle + 0x6C)*brk_multiplier) end end else if enable_player_leap[Map] then if jumps[player] == 0 and readbyte(m_object + 0x4CC) == 1 and readbit(m_object + 0x208, 1) then sendconsoletext(player, "Leap Frog!") jumps[player] = math.floor(pause_time_players[Map]*30) writebit(m_object + 0x10, 5, 0) writefloat(m_object + 0x70, player_velocity[Map]/10) end end end end end function getdriverplayer(m_vehicle) local obj_id = readdword(m_vehicle + 0x324) if obj_id ~= 0xFFFFFFFF then return objectidtoplayer(obj_id) end end function timedannounce(id, count, player) if getplayer(player) then if enable_vehicle_leap[Map] then sendconsoletext(player, "Vehicle Leap-Frog is Enabled.") end if enable_player_leap[Map] then sendconsoletext(player, "Player Leap-Frog is Enabled.") end end return false end function getplayervehicleid(player) return readdword(getobject(getplayerobjectid(player)) + 0x11C) end -- This script, was made by myself H® Shaft and Aelite, but did not duplicate any portion of OUR original script from 5/2012 written by Wizard and H® Shaft. -- 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