IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Store 1-2 characters to variables

 
HeresOtis  
Posted: Monday, May 21 2012, 23:19
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

us.gif

XXXXX



How can I store 1-2 variables to a variable and then have it displayed using (below) which the variable will be the direction the player is going?
CODE
045B: draw_text_2numbers 600.0 420.0 GXT 'OJs_DSp' numbers P_DirectionText_1 P_ReadX  // ~y~~1~ ~w~Speed: ~1~ MPH


Part of code where storing characters:
CODE
if and
   P_CarAngle >= 327.5
   22.5 >= P_CarAngle    // North
then
   P_DirectionText_1 = 'N'
else
   if and
       P_CarAngle > 22.5
       67.5 > P_CarAngle    // Northwest
   then
       P_DirectionText_1 = 'NW'
   else
       if and
           P_CarAngle >= 67.5
           112.5 >= P_CarAngle    // West
       then
           P_DirectionText_1 = 'W'
       else
           if and
               P_CarAngle > 112.5
               157.5 > P_CarAngle    // Southwest
           then
               P_DirectionText_1 = 'SW'
           else
               if and
                   P_CarAngle >= 157.5
                   202.5 >= P_CarAngle    // South
               then
                   P_DirectionText_1 = 'S'
               else
                   if and
                       P_CarAngle > 202.5
                       247.5 > P_CarAngle    // Southeast
                   then
                       P_DirectionText_1 = 'SE'
                   else
                       if and
                           P_CarAngle >= 247.5
                           292.5 >= P_CarAngle    // East
                       then
                           P_DirectionText_1 = 'E'
                       else
                           if and
                               P_CarAngle > 292.5
                               327.5 > P_CarAngle    // Northeast
                           then
                               P_DirectionText_1 = 'NE'
                           end
                       end
                   end
               end
           end
       end
   end
end
return
PM
  Top
 

 
Deji  
Posted: Tuesday, May 22 2012, 09:38
Quote Post


Coding like a Rockstar!
Group Icon
Group: Members
Joined: Dec 24, 2007

ja.gif

XXXXX



P_DirectionText_1 == ?
It cant be used as a number param if its a string var...
Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Tuesday, May 22 2012, 15:33
Quote Post


Mark Chump
Group Icon
Group: Members
Joined: Apr 29, 2011

us.gif

XXXXX



Just decided to use
CODE
:AddDynamicGXT
0ADF: add_dynamic_GXT_entry 'OJs_Dn' text "~y~N ~w~Speed: ~1~ MPH"
0ADF: add_dynamic_GXT_entry 'OJs-Dnw' text "~y~NW ~w~Speed: ~1~ MPH"
0ADF: add_dynamic_GXT_entry 'OJs-Dw' text "~y~W ~w~Speed: ~1~ MPH"
0ADF: add_dynamic_GXT_entry 'OJs-Dsw' text "~y~SW ~w~Speed: ~1~ MPH"      
0ADF: add_dynamic_GXT_entry 'OJs-Ds' text "~y~S ~w~Speed: ~1~ MPH"
0ADF: add_dynamic_GXT_entry 'OJs-Dse' text "~y~SE ~w~Speed: ~1~ MPH"
0ADF: add_dynamic_GXT_entry 'OJs-De' text "~y~E ~w~Speed: ~1~ MPH"
0ADF: add_dynamic_GXT_entry 'OJs-Dne' text "~y~NE ~w~Speed: ~1~ MPH"  
return
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG