[C++] RestartGame Problem...

S

Suppraza

Guest
I tried to add it to some project (No s0beit Project.) and this crash....  :face_palm:
(SAMP 0.3.7)

Code:
void restartGame()
{
	unsigned int samp_info = (unsigned int)g_dwSampAddr + 0x21A0F8;
	unsigned int func = (unsigned int)g_dwSampAddr + 0xA060;
	__asm
	{
		MOV eax, dword ptr[samp_info]
		MOV ecx, dword ptr[eax]
		CALL func
		POP eax
		POP ecx
	}
}
Code:
void restartGame()
{
	uint32_t samp_info = g_dwSampAddr + 0x21A0F8;
	uint32_t func = g_dwSampAddr + 0xA060;
	__asm
	{
		MOV eax, dword ptr[samp_info]
		MOV ecx, dword ptr[eax]
		CALL func
		POP eax
		POP ecx
	}
}
 
S

Suppraza

Guest
BUMP +

How i can add this to cpp project:
Code:
void  *lpPtr = g_Players->pLocalPlayer;

I search for it on s0beit and i found only this:
Code:
struct stLocalPlayer
{
	struct stSAMPPed		*pSAMP_Actor;
	uint16_t				sCurrentAnimID;
	uint16_t				sAnimFlags;
	uint32_t				ulUnk0;
	int						iIsActive;
	int						iIsWasted;
	uint16_t				sCurrentVehicleID;
	uint16_t				sLastVehicleID;
	struct stOnFootData		onFootData;
	struct stPassengerData	passengerData;
	struct stTrailerData	trailerData;
	struct stInCarData		inCarData;
	struct stAimData		aimData;
	uint8_t					byteTeamID;
	int						iSpawnSkin;
	uint8_t					byteUnk1;
	float					fSpawnPos[3];
	float					fSpawnRot;
	int						iSpawnWeapon[3];
	int						iSpawnAmmo[3];
	int						iIsActorAlive;
	int						iSpawnClassLoaded;
	uint32_t				ulSpawnSelectionTick;
	uint32_t				ulSpawnSelectionStart;
	int						iIsSpectating;
	uint8_t					byteTeamID2;
	uint16_t				usUnk2;
	uint32_t				ulSendTick;
	uint32_t				ulSpectateTick;
	uint32_t				ulAimTick;
	uint32_t				ulStatsUpdateTick;
	uint32_t				ulWeapUpdateTick;
	uint16_t				sAimingAtPid;
	uint16_t				usUnk3;
	uint8_t					byteCurrentWeapon;
	uint8_t					byteWeaponInventory[13];
	int						iWeaponAmmo[13];
	int						iPassengerDriveBy;
	uint8_t					byteCurrentInterior;
	int						iIsInRCVehicle;
	uint16_t				sTargetObjectID;
	uint16_t				sTargetVehicleID;
	uint16_t				sTargetPlayerID;
	struct stHeadSync		headSyncData;
	uint32_t				ulHeadSyncTick;
	BYTE					byteSpace3[260];
	struct stSurfData		surfData;
	int						iClassSelectionOnDeath;
	int						iSpawnClassID;
	int						iRequestToSpawn;
	int						iIsInSpawnScreen;
	uint32_t				ulUnk4;
	uint8_t					byteSpectateMode;		// 3 = vehicle, 4 = player, side = 14, fixed = 15
	uint8_t					byteSpectateType;		// 0 = none, 1 = player, 2 = vehicle
	int						iSpectateID;
	int						iInitiatedSpectating;
	struct stDamageData		vehicleDamageData;
};

My second question is: Where all the defines for "struct stLocalPlayer"
 
Top