Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Server.dat patch
Re: Server.dat patch [message #443685 is a reply to message #443566] Tue, 08 February 2011 10:04 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
Backup 6 bytes at 3 addresses: 0x474CF0, 0x4616A0, 0x0472c95

To pause,

Write {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3} at 0x474CF0
Write {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3} at 0x4616A0
Write {0x90, 0x90, 0x90, 0x90, 0x90, 0x90} at 0x0472c95

To resume, just restore the backed up bytes.



If you are using the LuaPlugin, the following code should work:

function Pause_Game()
	Stop_Game_Tmp = MemoryRead(0x474CF0, 6)
	NoGameover_Tmp = MemoryRead(0x4616A0, 6)
	Pause_Tmp = MemoryRead(0x0472c95, 6)
	
	MemoryWrite(0x474CF0, {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3})
	MemoryWrite(0x4616A0, {0xB8, 0x00, 0x00, 0x00, 0x00, 0xC3})
	MemoryWrite(0x0472c95, {0x90, 0x90, 0x90, 0x90, 0x90, 0x90})
end

function Resume()
	if NoGameover_Tmp == nil or Stop_Game_Tmp == nil or Pause_Tmp == nil then
		return
	end
	MemoryWrite(0x474CF0, Stop_Game_Tmp)
	MemoryWrite(0x4616A0, NoGameover_Tmp)
	MemoryWrite(0x0472c95, Pause_Tmp)	
end
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Assassin's Creed Models
Next Topic: Remove player list
Goto Forum:
  


Current Time: Sun Nov 24 20:33:06 MST 2024

Total time taken to generate the page: 0.00880 seconds