ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1876

Cardinal points ( north, south, east, and west )

by Cayman_-Modz - 03-02-2019 - 11:34 PM
#1
who gives me some advice to make this code possible to indicate the cardinal points???

 char heading[50]; 

float pedheading = GET_ENTITY_HEADING(GET_PLAYER_PED(SelectPlayer));

snprintf(heading, sizeof(heading), "H  : %d", (int)pedheading);

InfoText(heading, optionsFont, X2, Y2, 0.4f, 0.4f, 255, 255, 255, 250, false);
Reply
#2
float heading = _GET_ENTITY_PHYSICS_HEADING(player);
char xDDDDDDDD[50];
snprintf(xDDDDDDDDD, sizeof(xDDDDDDDD), "<C>%s</C> <-", heading);
InfoText(xDDDDDDDD, .....,....,....,........,....,...true);


: %s = string : %d = decimal : %i = integer
Reply
#3
(03-03-2019 - 12:21 AM)dabexclusive Wrote: float heading = _GET_ENTITY_PHYSICS_HEADING(player);
char xDDDDDDDD[50];
snprintf(xDDDDDDDDD, sizeof(xDDDDDDDD), "<C>%s</C> <-", heading);
                       InfoText(xDDDDDDDD, .....,....,....,........,....,...true);

I tried several times but it does not work.. bro

I used the native  

static float _GET_ENTITY_PHYSICS_HEADING(Entity entity) { return invoke<float>(0x846BF6291198A71E, entity); } // 0x846BF6291198A71E

thank you for the help.. 

if you know anything else let me know thank you!!
Reply
#4
(03-02-2019 - 11:34 PM)Cayman_-Modz Wrote: who gives me some advice to make this code possible to indicate the cardinal points???

 char heading[50]; 

float pedheading = GET_ENTITY_HEADING(GET_PLAYER_PED(SelectPlayer));

snprintf(heading, sizeof(heading), "H  : %d", (int)pedheading);

InfoText(heading, optionsFont, X2, Y2, 0.4f, 0.4f, 255, 255, 255, 250, false);

lol

just do %f

char buf[50]
float player_heading = // Get heading
sprintf(buf, "%f" player_heading)
print_info(buf)
Reply
#5
Return heading and translate to a compass. Example: If(heading > 0 && heading < 360/4) return "North";
Reply

Users browsing: 1 Guest(s)