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

 Reading the date

 cleo
 
HeresOtis  
Posted: Wednesday, Jun 6 2012, 16:16
Quote Post


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

XXXXX



I want to read the date from a file, but not an .ini file because the user would have to change it every day. Is there a file somewhere on the computer that stores the date and how can I read it in CLEO4?
PM
  Top
 

 
Wesser  
Posted: Wednesday, Jun 6 2012, 17:22
Quote Post


The complexity simplifier, the efficiency optimizer
Group Icon
Group: Members
Joined: Aug 19, 2006

eu.gif

Member Award




You can take advantage of the imported GetLocalTime function (from Kernel32.dll) located at 0x85811C. The first argument is a pointer to a SYSTEMTIME structure documented here. I cannot give the full code right now, so good luck. smile.gif
PMMSNPlayStation Network
  Top
 

 
DK22Pac  
Posted: Wednesday, Jun 6 2012, 17:24
Quote Post


Assembly!
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



http://sannybuilder.com/forums/viewtopic.php?pid=8407#p8407
CODE
0AC8: 0@ = allocate_memory_size 16
0AA5: call 0x85811C num_params 1 pop 0 0@
0085: 1@ = 0@
for 2@ = 0 to 7
   0A8D: 3@(2@,8i) = read_memory 1@ size 2 virtual_protect 0
   1@ += 2        
end
0AC9: free_allocated_memory 0@
{
After this, we have:
3@ - Year
4@ - Month
5@ - DayOfWeek
6@ - Day
7@ - Hour
8@ - Minute
9@ - Second
10@ - Milliseconds
}


This post has been edited by DK22Pac on Wednesday, Jun 6 2012, 17:34
Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Wednesday, Jun 6 2012, 23:55
Quote Post


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

XXXXX



Thanks.
PM
  Top
 

 
HeresOtis  
Posted: Friday, Jun 8 2012, 05:20
Quote Post


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

XXXXX



Okay, I tested the script and it keeps crashing for me after the SA loading bar is complete.
PM
  Top
 

 
DK22Pac  
Posted: Friday, Jun 8 2012, 10:46
Quote Post


Assembly!
Group Icon
Group: Members
Joined: Apr 12, 2009

un.gif

XXXXX



CODE
{$CLEO}
0AC8: 0@ = allocate_memory_size 16
while true
   wait 250
   0A8D: 31@ = read_memory 0x85811C size 4 virtual_protect 0
   0AA5: call 31@ num_params 1 pop 0 0@
   0085: 1@ = 0@
   for 2@ = 0 to 7
       0A8D: 3@(2@,8i) = read_memory 1@ size 2 virtual_protect 0
       1@ += 2        
   end
   0ACE: show_formatted_text_box "%d-%d-%d, %d:%d:%d" 6@ 4@ 3@ 7@ 8@ 9@
end
Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Friday, Jun 8 2012, 23:43
Quote Post


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

XXXXX



Now that I have the day, month, and year, how would I be able to combine them together (like 6/8/2012) and display it using a draw_text opcode? I don't want to use show_text_priority.
PM
  Top
 

 
Deji  
Posted: Saturday, Jun 9 2012, 00:42
Quote Post


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

ja.gif

XXXXX



Users WebsitePM
  Top
 

 
HeresOtis  
Posted: Saturday, Jun 9 2012, 20:37
Quote Post


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

XXXXX



Will this work properly:
CODE
0AF4: 0@v = read_string_from_ini_file INI_FileName section "Main" key "Date"    //   6/9/2012 is stored in the variable
0AD3: 10@v = format "Date: %s" 0@v
0ADF: add_dynamic_GXT_entry "Date" text 10@v    // So now Date: 6/9/2012
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