0x32789
Expert
So this thing for some reason when I hook into the RakClient in SA-MP (0.3.DL), it works but everytime I want to exit or I exit the game. I kinda get a crash popup but I don't really crash, like when I /q it says your game has crashed but I leave as "leaving/quit" in the server rather than "crashed".
What can be the fix of this? Also if I'm not mistaken s0biet used to have a issue like this before and it was fixed but I cannot find it.
	
	
	
		
			
			What can be the fix of this? Also if I'm not mistaken s0biet used to have a issue like this before and it was fixed but I cannot find it.
		Code:
	
	  g_SAMP = (DWORD)GetModuleHandle("samp.dll");
   
    bool initSampRak = false;
    while (true)
    {
        if (!initSampRak)
        {
            if (memcmp_safe((uint8_t*)g_SAMP + 0xBABE, hex_to_bin(SAMP037_CMP), 10))
            {
                samp037 = true;
            }
            else samp037 = false;
            if (samp037)
            {
                // same sht just like for 037 diff structs etc
            }
            else
            {
                g_stSAMP = stGetSampInfo();
                if (isBadPtr_writeAny(g_stSAMP, sizeof(stSAMP)))
                {
                    MessageBox(0, "stSamp BadPtr", "INIT ERR", 0);
                    continue;
                }
                if (isBadPtr_writeAny(g_stSAMP->pPools, sizeof(stSAMPPools)))
                {
                    MessageBox(0, "stSamp->pPools BadPtr", "INIT ERR", 0);
                    continue;
                }
                g_Chat = stGetSampChatInfo();
                if (isBadPtr_writeAny(g_Chat, sizeof(stChatInfo)))
                {
                    MessageBox(0, "g_Chat BadPtr", "INIT ERR", 0);
                    continue;
                }
                g_Input = stGetInputInfo();
                if (isBadPtr_writeAny(g_Input, sizeof(stInputInfo)))
                {
                    MessageBox(0, "g_Input BadPtr", "INIT ERR", 0);
                    continue;
                }
                if (g_stSAMP->pRakClientInterface == NULL)
                {
                    MessageBox(0, "RakClient == NULL", "INIT ERR", 0);
                    continue;
                }
                g_RakClient = new RakClient(g_stSAMP->pRakClientInterface);
                g_stSAMP->pRakClientInterface = new HookedRakClientInterface();
            }
            initSampRak = true;
        }