Log in to reply
 

Sending code from GTA to text file



  • I had recently written a simple vb.net script which allowed me to increment/decrement vector 3 coordinates to attach a prop to a ped or to attach a ped (with the prop or without) to a chair for example. To get the final 6 coordinates I had them displayed on the screen so they could be written down and then used in the final script.
    Today I realized this could likely be done in the tool itself. With one line of code. Here I'm just returning the coordinates but I could also, with concatenation, return the full native function with all parameters.

    Thought it was sort of cool, so sharing it for other new modders.

    CodeString = "X = " & PX1 & " Y = " & PY1& & " Z = " & PZ1 & "~n~ ~b~ X = " & PX & " Y = " & PY& & " Z = " & PZ

    My.Computer.FileSystem.WriteAllText("m:\Code.txt", CodeString, False)

    n.b. string above has line breaks and colours, which obviously would be removed before sending to text file.
    P.S. You will need permission on the folder you write to (file save location), if not it will compile perfectly but GTA will throw out some cryptic error message which has nothing to do with write permissions. I'm going to try reading and displaying from a text file now, just for fun.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.