So there are two codes here. The subroutine monitors when you die, and will automatically respawn for you. The subroutine also will prevent the mission from failing. The other code enables respawn in single player since the functions are normally only called when playing online.
Source
Code:
202CED04 0802E424 200B9090 27BDFFD0 200B9094 FFBF0030 200B9098 3C010069 200B909C 7FB20020 200B90A0 7FB10010 200B90A4 7FB00000 200B90A8 A0204D70 200B90AC 0C0ACD60 200B90B0 00000000 200B90B4 0040802D 200B90B8 12000015 200B90BC 00000000 200B90C0 3C010043 200B90C4 8C317DC8 200B90C8 82310004 200B90CC 12200003 200B90D0 00000000 200B90D4 1000000E 200B90D8 00000000 200B90DC 24020001 200B90E0 A2220004 200B90E4 3C01000C 200B90E8 8C329060 200B90EC 24030050 200B90F0 16430005 200B90F4 00000000 200B90F8 A2020FCF 200B90FC AC209060 200B9100 10000003 200B9104 00000000 200B9108 26520001 200B910C AC329060 200B9110 DFBF0030 200B9114 7BB20020 200B9118 7BB10010 200B911C 7BB00000 200B9120 03E00008 200B9124 27BD0030 Enable Respawn Offline 2055205C 00000000
Code:
address $200b9090 addiu sp, sp, $ffd0 sd ra, $0030(sp) lui at, $0069 sq s2, $0020(sp) sq s1, $0010(sp) sq s0, $0000(sp) sb zero, $4d70(at) jal $002B3580 nop daddu s0, v0, zero beq s0, zero, :end nop lui at, $0043 lw s1, $7DC8(at) lb s1, $0004(s1) beq s1, zero, :respawn nop beq zero, zero, :end nop respawn: addiu v0, zero, $0001 sb v0, $0004(s1) lui at, $000C lw s2, $9060(at) addiu v1, zero, $0050 bne s2, v1, :increment nop sb v0, $0fcf(s0) sw zero, $9060(at) beq zero, zero, :end nop increment: addiu s2, s2, $0001 sw s2, $9060(at) end: ld ra, $0030(sp) lq s2, $0020(sp) lq s1, $0010(sp) lq s0, $0000(sp) jr ra addiu sp, sp, $0030
Comment