CLEO Help 0B24: samp 1@ = get_player_struct_ptr 0@

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Is there anyone who could explain to a noob what's the potential use of this opcode and how to use it properly?

+

Is the 1@ from code below:
Code:
0B2B: samp 2@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B24: samp 1@ = get_player_struct_ptr 2@

The same as 1@ from this code:
Code:
0A96: 1@ = actor $PLAYER_ACTOR struct
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
samp 1@ = get_player_struct_ptr 0@ returns player pointer to stRemotePlayerData structure (SAMP.dll) -- (or maybe stRemotePlayer struct)Correct me if i am wrong.

PHP:
struct stRemotePlayerData
{
#pragma pack( 1 )
uint16_t	sPlayerID;
uint16_t	sVehicleID;
uint8_t	byteTeamID;
uint8_t	bytePlayerState;
uint8_t	byteSeatID;
uint32_t	ulUnk0;
int	iPassengerDriveBy;
struct stSAMPVehicle	*pSAMP_Vehicle;
struct stSAMPPed	*pSAMP_Actor;
uint8_t	byteUnk1[40];
float	fOnFootPos[3];
float	fOnFootMoveSpeed[3];
float	fVehiclePosition[3];
float	fVehicleMoveSpeed[3];
float	fVehicleRoll[4];
int	iShowNameTag;
int	iHasJetPack;
uint8_t	byteSpecialAction;
struct stTrailerData	trailerData;
struct stPassengerData	passengerData;
struct stAimData	aimData;
struct stInCarData	inCarData;
struct stOnFootData	onFootData;
uint8_t	byteUnk2;
uint32_t	dwLastStreamedInTick; // is 0 when currently streamed in
uint32_t	dwTick;
uint32_t	ulUnk3;
float	fActorHealth;
float	fActorArmor;
int	iUnk4;
int	iAFKState;
struct stHeadSync	headSyncData;
int	iGlobalMarkerLoaded;
int	iGlobalMarkerLocation[3];
uint32_t	ulGlobalMarker_GTAID;
};

0A96: 1@ = actor $PLAYER_ACTOR struct
returns pointer to cPed structure(GTA_SA.exe) (where it has player position, rotation, health, armor, weapon slots, jump state, etc...)

anyways, they're not the same.
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
monday link said:
Thanks, btw is there any tutorial about stRemotePlayerData structure including offsets needed to get specific data? Something analogical to this: http://www.gtamodding.com/index.php?title=Memory_Addresses_(SA)

you can use the structure i gave you in my last post.

for example:
Code:
0B24: samp 1@ = get_player_struct_ptr 2@
1@ += 2
// 1@ is now the address of the variable uint16_t sVehicleID (the offset of it is 0x2)
1@ += 3
// 1@ is now the address of the variable uint8_t bytePlayerState(the offset of it is 0x5)

basically you just take a look at the structure i gave you, and when you want to use it in cleo you just keep adding the sizes of the variables until you get the offset of the variable u need.

sizes:
uint16_t  - 2 bytes.
uint8_t - 1 byte.
uint32_t / int / float - 4 bytes.
uint16_t somevariable[2] 2*2 = 4 bytes.
float asomevariable[3] 3*4 = 12 bytes.
 
Status
Not open for further replies.
Top