From 102cd8217677e47dc65752d9b3300739e8812bb1 Mon Sep 17 00:00:00 2001 From: kurta999 Date: Tue, 12 Aug 2014 14:11:39 +0200 Subject: [PATCH] Added support for 0.3z R4 --- Addresses.cpp | 11 +++++++++-- Addresses.h | 2 ++ CServer.cpp | 1 - main.cpp | 5 +++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Addresses.cpp b/Addresses.cpp index 62e9542..8be571f 100644 --- a/Addresses.cpp +++ b/Addresses.cpp @@ -6,10 +6,12 @@ DWORD CAddress::FUNC_Logprintf_03Z = 0x00486CB0; DWORD CAddress::FUNC_Logprintf_03ZR2_2 = 0x00487310; DWORD CAddress::FUNC_Logprintf_03ZR3 = 0x00487460; +DWORD CAddress::FUNC_Logprintf_03ZR4 = 0x004875F0; #else DWORD CAddress::FUNC_Logprintf_03Z = 0x080A7440; DWORD CAddress::FUNC_Logprintf_03ZR2_2 = 0x080A77D0; DWORD CAddress::FUNC_Logprintf_03ZR3 = 0x080A78E0; +DWORD CAddress::FUNC_Logprintf_03ZR4 = 0x80A7A90; #endif // Pointers @@ -65,7 +67,7 @@ void CAddress::Initialize(eSAMPVersion sampVersion) //ADDR_RECEIVE_HOOKPOS = 0x458B80; break; } - case SAMP_VERSION_03Z_R2_2: + case SAMP_VERSION_03Z_R4: { //ADDR_RECEIVE_HOOKPOS = 0x458A20; break; @@ -118,7 +120,12 @@ void CAddress::Initialize(eSAMPVersion sampVersion) FUNC_CConsole_SetIntVariable = 0x809EFB0; ADDR_RECEIVE_HOOKPOS = 0x080AD1FF; - asd = 0x080AF1E7; + break; + } + case SAMP_VERSION_03Z_R4: + { + VAR_pRestartWaitTime = 0x81514E0; // 12.0 + FUNC_CConsole_SetIntVariable = 0x809EFB0; // find for maxplayers break; } } diff --git a/Addresses.h b/Addresses.h index 59da705..61d5fee 100644 --- a/Addresses.h +++ b/Addresses.h @@ -41,6 +41,7 @@ enum eSAMPVersion SAMP_VERSION_03Z, SAMP_VERSION_03Z_R2_2, SAMP_VERSION_03Z_R3, + SAMP_VERSION_03Z_R4, SAMP_VERSION_SKIPPED, }; @@ -53,6 +54,7 @@ class CAddress static DWORD FUNC_Logprintf_03Z; static DWORD FUNC_Logprintf_03ZR2_2; static DWORD FUNC_Logprintf_03ZR3; + static DWORD FUNC_Logprintf_03ZR4; // Pointers static DWORD VAR_ppNetGame; diff --git a/CServer.cpp b/CServer.cpp index 69b209e..a89f6e4 100644 --- a/CServer.cpp +++ b/CServer.cpp @@ -102,7 +102,6 @@ bool CServer::OnPlayerStreamIn(unsigned short playerid, unsigned short forplayer bool CServer::OnPlayerStreamOut(unsigned short playerid, unsigned short forplayerid) { - return 1; //logprintf("leave stream zone playerid = %d, forplayerid = %d", playerid, forplayerid); PlayerID playerId = pRakServer->GetPlayerIDFromIndex(playerid); PlayerID forplayerId = pRakServer->GetPlayerIDFromIndex(forplayerid); diff --git a/main.cpp b/main.cpp index 0ff96f5..563466d 100644 --- a/main.cpp +++ b/main.cpp @@ -82,6 +82,11 @@ PLUGIN_EXPORT bool PLUGIN_CALL Load(void ** ppData) version = SAMP_VERSION_03Z_R3; strcpy(szVersion, "0.3z R3"); } + else if(logprintf == (logprintf_t)CAddress::FUNC_Logprintf_03ZR4) + { + version = SAMP_VERSION_03Z_R4; + strcpy(szVersion, "0.3z R4"); + } // If not unknown, then initalize things if(version != SAMP_VERSION_UNKNOWN)