Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

It is possible?


Kilowog01
 Share

Recommended Posts

 

I need to enter a command in the chat. Follow a path. Enter another command in the chat. Make my way back and repeat this loop.

 

The script Opcode.exe does not suit me. Then I thought of using small parts of his code (or maybe none because nothing there helps this much...)

 

I wanted to create a script to read a .txt or .ini file line by line with something like:

 

coodX CoordY coordZ SpeedKMH Angle (maybe?)

 

This way I can create a clean way, without unnecessary curves without loss of speed and consequently time. Because when I record my path with his code ... well ... I'm human, right? If I have to stop in a place and I'm at full speed, I have 95% chance to stop or too early or too late. With this my idea I could test a 2 or 3 times and get a precise number.

And I did not want those gimmick, lines on the screen, colorful things, points on the map and all that can betray me, preventing me from taking printscreens without risk of being banned.

I have sanny installed with sampfuncs, I have done a basic script but this is far beyond my ability, someone can give me a direction?

 

This is the path that i need to follow, and then you guys can see, is a looong path.

wOXofyV.jpg

Driving normally, this path takes about 3 minutes (without the time of the way back) even if I do not crash the car but I'm sure I can reach 2 minutes and 30 seconds with the correct path.

 

I just started with this, trying to simplify the code

 

 

{$CLEO .cs}0000:REPEAT    WAIT 0UNTIL 0AFA:  SAMP_IS_READY0B34: "CB" @ativacao WHILE TRUEwait 0if [email protected] == 1then   :scriptIF AND0AAB:   file_exists "CLEO\pos.ini"00DF:   actor $PLAYER_ACTOR drivingTHEN0AF2: [email protected] = get_int_from_ini_file "cleo\pos.ini" section "1" key "X"0AF2: [email protected] = get_int_from_ini_file "cleo\pos.ini" section "1" key "Y"     0AF2: [email protected] = get_int_from_ini_file "cleo\pos.ini" section "1" key "Z"0AF2: [email protected] = get_int_from_ini_file "cleo\pos.ini" section "1" key "S"                            0407: [email protected] [email protected] [email protected] CAR [email protected] w_OFFSET 0.0 0.0 0.0                             0AB1: call_scm_func @turning_mechanism 4 [email protected] [email protected] [email protected] [email protected]                             02E3: [email protected] = car [email protected] speed                            IF                            0025:   [email protected] > [email protected]  // (float)                            THEN                                0AB1: @BRAKE 0                                ELSE                                0AB1: @GAS 0                          END                          END    jump @scriptendEND :ativacao0B12: [email protected] = [email protected] XOR 1if [email protected] == 1then 0AF8: "{FF0000}CLEO:{FFFFFF} CB Ativado!" -1else 0AF8: "{FF0000}CLEO:{FFFFFF} CB Desativado!" -1END   0B43://0AB1: call_scm_func @turning_mechanism 4 XY XY:turning_mechanism0AB1: @getZAngleBetweenPoints 4 from_XY [email protected] [email protected] and_XY [email protected] [email protected] store_to [email protected]       0172: [email protected] = actor $PLAYER_ACTOR [email protected] -= 360.00097: make [email protected] absolute_float005B: [email protected] += [email protected]: [email protected] = sine [email protected]: [email protected] = cosine [email protected]: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]    if and    0021:   [email protected] > 180.0    0023:   355.0 > [email protected]    then //press left    0B56: set_game_key 0 state -255    //0B56: set_game_key 16 state 255        if        0023:   200.0 > [email protected]        then        0B56: set_game_key 6 state 255        else        0B56: set_game_key 6 state 0        end                             else        if and        0021:   [email protected] > 5.0        0033:   180.0 >= [email protected] //lower or equal         then //press right         0B56: set_game_key 0 state 255        //0B56: set_game_key 16 state 255            if            0021:   [email protected] > 160.0            then            0B56: set_game_key 6 state 255            else            0B56: set_game_key 6 state 0            end        else        0B56: set_game_key 0 state 0        0B56: set_game_key 6 state 0        //0B56: set_game_key 16 state 255        end    end0AB2: ret 0 :getZAngleBetweenPoints0063: [email protected] -= [email protected]: [email protected] -= [email protected]: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]: 1 [email protected] :[email protected] = [email protected] += 0xC0A8C: write_memory [email protected] size 1 value 255 virtual_protect 00AB2: 0 :[email protected] = [email protected] += 0x200A8C: write_memory [email protected] size 1 value 255 virtual_protect 00AB2: 0  

But its crashes when i enter the comand in chat

Edited by Kilowog01
Link to comment
Share on other sites

Why do you wanna read coords from txt file?

First method to record path and let vehicle drive on path is the "carrec script" (let vehicle move along carrec paths like the planes from Airport feature or the big truck in this mission)

But i don't know if a custom carrec.img is usable in SA-MP

 

If you wanna store and read informations into/from a file, then make it with ini file, therefor were opcodes of cleo4 created.

 

sampfuncs is not needed, sampfuncs is need to manipulate serverside content while playing SA-MP

Link to comment
Share on other sites

Why do you wanna read coords from txt file?

First method to record path and let vehicle drive on path is the "carrec script" (let vehicle move along carrec paths like the planes from Airport feature or the big truck in this mission)

But i don't know if a custom carrec.img is usable in SA-MP

 

If you wanna store and read informations into/from a file, then make it with ini file, therefor were opcodes of cleo4 created.

 

sampfuncs is not needed, sampfuncs is need to manipulate serverside content while playing SA-MP

Dont need necessarily to be a .txt, it could be any file as long as it was easily editable. If I well understand .path are binary files automatically generated by the machine, and that I can not edit.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.