Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Super Jump
- -- by H® Shaft for SAPP
- -- Script allows use of dev-mode super-jump in multiplayer.
- -- fall damage is off to prevent player damage when landing
- -- players sometimes de-sync, (can't see themselves jumping high), it resolves itself shortly, or upon death
- api_version = "1.9.0.0"
- game_started = false
- team_play = false
- function OnScriptLoad()
- register_callback(cb['EVENT_JOIN'], "OnPlayerJoin")
- register_callback(cb['EVENT_SPAWN'], "OnPlayerSpawn")
- register_callback(cb['EVENT_GAME_START'], "OnNewGame")
- register_callback(cb['EVENT_TICK'],"OnTick")
- register_callback(cb['EVENT_DIE'], "OnPlayerDeath")
- if get_var(0, "$gt") ~= "n/a" then
- game_started = true
- for i = 1, 16 do
- if player_present(i) then
- OnPlayerSpawn(i)
- end
- end
- end
- end
- function OnPlayerSpawn(PlayerIndex)
- if (game_started == true) then
- if player_alive(PlayerIndex) then
- write_dword(get_player(PlayerIndex) + 0xF0, 0)
- write_dword(get_player(PlayerIndex) + 0x164, 0)
- execute_command_sequence('cheat_super_jump 1;cheat_jetpack 1', PlayerIndex)
- end
- end
- end
- function OnPlayerJoin(PlayerIndex)
- if (game_started == true) then
- write_dword(get_player(PlayerIndex) + 0x2C, 60)
- end
- end
- function OnNewGame()
- game_started = true
- for i = 1, 16 do
- if player_present(i) then
- write_dword(get_player(i) + 0x2C, 60)
- execute_command_sequence('cheat_super_jump 1;cheat_jetpack 1', i)
- end
- end
- end
- function OnTick()
- if (game_started == true) then
- for PlayerIndex=1,16 do
- if player_present(PlayerIndex) then
- if player_alive(PlayerIndex) then
- local player_object = get_dynamic_player(PlayerIndex)
- if (player_object ~= 0) then
- write_dword(get_player(PlayerIndex) + 0xF0, 0)
- write_dword(get_player(PlayerIndex) + 0x164, 0)
- end
- end
- end
- end
- end
- end
- function OnPlayerDeath(PlayerIndex, KillerIndex)
- if (game_started == true) then
- -- sets respawn to 1.5 seconds
- execute_command_sequence('nades me 0;wdel me *', PlayerIndex)
- local player_obj_id = read_dword(get_player(PlayerIndex) + 0x34)
- if (player_obj_id ~= 0xFFFFFFFF) then
- write_dword(get_player(PlayerIndex) + 0x2C, 60)
- end
- end
- end
- function OnScriptUnload()
- execute_command_sequence('cheat_super_jump 0;cheat_jetpack 0')
- end
- function getteamplay()
- if readbyte(gametype_base + 0x34) == 1 then
- return true
- else
- return false
- end
- end
- -- Created by H® Shaft
- -- Visit http://halorace.org/forum/index.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement