[C++, HELP] Get if SAMP Available

P

pa0neix

Guest
How i can check if samp available (Address??, Offsets??)

Code:
#include "main.h"
DWORD g_dwSAMP_Addr = NULL;

void LoadSAMP()
{
	while (g_dwSAMP_Addr == NULL)
	{
		g_dwSAMP_Addr = (DWORD)GetModuleHandle("samp.dll");
		sleep(250);
	}
}

void CheckSAMP()
{
	while (/* How to check if samp available ??? */)
	{
		// Codes...
		sleep(250);
	}
}

void main()
{
	LoadSAMP();
	while (true)
	{
		GAME.GTA_SA.SetPlayerPos(0, 0, 0);
		sleep(25);
	}
}

BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
	DisableThreadLibraryCalls(hDll);
	if (dwReason == DLL_PROCESS_ATTACH)
		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)main, NULL, NULL, NULL);

	return TRUE;
}
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
wtf? Your code does that...
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Maybe you want to check if chat/input is initialized or player is spawned?  :imoverit:
 
P

pa0neix

Guest
0x688 link said:
wtf? Your code does that...
This is Code Makeshift..

springfield link said:
Maybe you want to check if chat/input is initialized or player is spawned?  :imoverit:
I need to check if samp is available to add commands and operation messages...
 

0x_

Wtf I'm not new....
Staff member
Administrator
Joined
Feb 18, 2013
Messages
1,123
Reaction score
174
so continue along by c+p'ing it out of s0b?
since you clearly don't even know what you started with.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
I check it like this
Code:
DWORD *stChat = *(DWORD**)(dwSAMP + CHAT_INFO);
 
P

pa0neix

Guest
springfield link said:
I check it like this
Code:
DWORD *stChat = *(DWORD**)(dwSAMP + CHAT_INFO);
Thanks! U R Awesome !!  :urtheman:  :forever_hurra:  :eek:mg_run:

0x688 link said:
so continue along by c+p'ing it out of s0b?
since you clearly don't even know what you started with.
I was noob in cpp at the beginning, and any little thing i was asking here for help,
But that was in the past.. :trollface:

And I'm stopped to add stuff to s0beit..
 
Top