Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- warning_msg = true -- Send players a warning to update their halo (intentions of this script, please use it!)
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(processid, game, persistent)
- Game = game
- if (game == "PC") then
- version_address = 0x5df840
- addr1 = 0x5992DE
- game_lobby = 0x6A1C80
- network_base = 0x745BA8
- sockaddr_pointer = 0x6A1F08
- else
- version_address = 0x564b34
- addr1 = 0x52DB7E
- game_lobby = 0x626100
- network_base = 0x6C7988
- sockaddr_pointer = 0x626388
- end
- sockaddr_in = readdword(sockaddr_pointer) + 0xC4
- writedword(addr1, 0x7530)
- lchanger = registertimer(30000, "lobbyChanger")
- end
- function OnScriptUnload()
- end
- function OnNewGame(map)
- sockaddr_in = readdword(sockaddr_pointer) + 0xC4
- if not lchanger then
- lchanger = registertimer(30000, "lobbyChanger")
- end
- end
- function OnGameEnd(stage)
- if stage == 1 then
- if lchanger then
- removetimer(lchanger)
- lchanger = nil
- end
- end
- end
- function OnPlayerJoin(player)
- if warning_msg then
- privatesay(player, "WARNING: Gamespy shutdown imminent. Update your halo if you haven't already.")
- privatesay(player, "http://tinyurl.com/EnHalo")
- end
- end
- function lobbyChanger(id, count)
- if Game == "PC" then
- if count % 2 == 0 then
- --Send to gamespy master server.
- writedword(sockaddr_in + 0x4, 0xF81E0A45)
- writestring(version_address, "01.00.09.0620")
- else
- --Send to new master server.
- writedword(sockaddr_in + 0x4, 0x77E65436)
- writestring(version_address, "01.00.10.0621")
- end
- else
- if count % 2 == 0 then
- --Send to gamespy master server.
- writedword(sockaddr_in + 0x4, 0xF81E0A45)
- writestring(version_address, "01.00.09.0620")
- else
- --Send to new master server.
- writedword(sockaddr_in + 0x4, 0x77E65436)
- writestring(version_address, "01.00.10.0621")
- end
- end
- return true
- end
- function writestring(addr, str)
- local l = 0
- for i = 1, #str do
- local c = string.byte(str, i)
- writebyte(addr + i - 1, c)
- l = l + 1
- end
- writebyte(addr + l, 0)
- end
Add Comment
Please, Sign In to add comment