PHP Code:
#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>
#define BUTTON_X 0x10
float GetOffset(float distance, char *type)
{
Vector3 result;
GET_PED_BONE_POSITION(GetPlayerPed(), BONE_RIGHT_HAND, distance, 0.0f, distance * -0.04f, &result);
if (COMPARE_STRING(type, "x"))
return result.x;
if (COMPARE_STRING(type, "y"))
return result.y;
if (COMPARE_STRING(type, "z"))
return result.z;
}
void main(void)
{
while(true)
{
WAIT(0);
if (IS_BUTTON_PRESSED(0, BUTTON_X))
{
DISPLAY_TEXT_WITH_FLOAT(0.5f, 0.4f, "NUMBR", GetOffset(20.0f, "x"), 8);
DISPLAY_TEXT_WITH_FLOAT(0.5f, 0.5f, "NUMBR", GetOffset(20.0f, "y"), 8);
DISPLAY_TEXT_WITH_FLOAT(0.5f, 0.6f, "NUMBR", GetOffset(20.0f, "z"), 8);
}
}
}