Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

A hard question about Gta 2 scripting :


Andrew_Thiago
 Share

Recommended Posts

Andrew_Thiago

Hi Sector! how are you? I have another great question to ask you, take a look at this:

 

LEVELSTART
phone1_mission1: ///Mission label
// Mission begins here!
SET mission1_failed = 0 //Doing that, i could restart the mission again setting the failed mission counter to zero isn't!
DELAY_HERE (30) POINT_ARROW_AT ( ar1, phone01 )
DISPLAY_BRIEF (1019)
ANSWER_PHONE ( boy , phone01 , 100 )
/////////////////////////////////////////////////////////////////////////////////////////////
WHILE_EXEC (onmission1 = 0)
IF (CHECK_ANSWERED_PHONE(phone01))
truck1 = CREATE_CAR ( 84.7,149.8,2.0 ) 23 090 TRUKCAB2 TRUKTRNS END
SET onmission1 = 2
STOP_PHONE ( phone01 )
DISPLAY_BRIEF (1020)
DELAY_HERE (40)
++onmission1
ENDIF
IF (CHECK_FAIL_PHONE_TIMER(phone01))
DISPLAY_BRIEF ( 1014 )
SET mission1_failed = 1
STOP_PHONE ( phone01 )
REMOVE_ARROW (ar1)
RETURN // I can't make that command work properly! The script did not restart After not answer the phone.
ENDIF
ENDWHILE
I just copied that script from another correct scripts, and then, i fixed some names etc.. But, even seeing how it works, if i failed to answer the phone, the script are not heading back to the mission label in the start.
OBS: And, why we have to write for example: ++onmission1 in the middle of the script? If i take this out of my codes, the compile just don't compile my script.
Thank you so much!, Andrew Thiago
Edited by Andrew_Thiago
Link to comment
Share on other sites

++onmission1 isn't needed and doesn't make any sense in that location. Not sure why that would stop you compiling, it didn't in my tests. I use mispad.

 

RETURN won't do anything without GOSUB or a thread trigger.

 

Instead of RETURN, you could try GOSUB phone1_mission1:

Edited by Sektor
Link to comment
Share on other sites

Andrew_Thiago

Yeah, but look: when i write GOSUB ... after the failed brief text, he points the phone again, but it creates a infinite loop that crash the game after 5 seconds. The same problem happens when i check if the vehicle is destroyed too. I created all the necesary counter, and his isn't the problem. Take at this:

 

LEVELSTART -------------------------------------------------------------------------------------------------------------------------

 

mission1: //mission1 Label

 

IF (mission1_failed = 1) //The the player failed the mission before.
SET mission1_failed = 0
ENDIF
ANSWER_PHONE ( boy , phone01 , 2000 )
POINT_ARROW_AT ( ar1, phone01 )
ENDIF
WHILE_EXEC (onmission1 = 0) // He didn't answer the phone yet
IF (CHECK_ANSWERED_PHONE(phone01)) //If he answer the phone
REMOVE_ARROW (ar1)
STOP_PHONE ( phone01 )
CLEAR_ALL_BRIEFS ( )
DISPLAY_BRIEF (1020) // Hello .....
SET onmission1 = 2 //This means he will be now doing that mission
truck1 = CREATE_CAR ( 84.7,149.8,2.0 ) 23 090 TRUKCAB2 TRUKTRNS END //It's the truck who i must get in
ENDIF
IF ( ( CHECK_FAIL_PHONE_TIMER(phone01 )) //Did not answer the phone on the time
AND ( mission1_failed = 0 ))
SET mission1_failed = 1
STOP_PHONE ( phone01 )
REMOVE_ARROW (ar1)
CLEAR_ALL_BRIEFS ( )
DISPLAY_MESSAGE ( 3730 )//You have failed the mission ...
I learned yesterday that we must put the original failed brief text in the script to everything work properly. But now, the GOSUB aren't working right.
GOSUB mission1: <----- //Is the " <---- GOSUB.." command on his right place in the end? Or must another problem?
ENDWHILE <-------------
ENDIF <-----------
///////////////////////////ANOTHER STUFFS....
OBS:
If i fail to answer the phone or the mission vehicle is destroyed, the GOSUB really head back to the label in the beginning, but its creates a infinite loop, then crashing the game.
That's the only problem that don't let me keep writing all the rest of the script that left for me to end
Link to comment
Share on other sites


PLAYER_PED boy = (82.10,148.3,2.0) 8 0

 

/////COUNTERS////

 

COUNTER onmission1 = 0

COUNTER inside_truck1 = 0

COUNTER mission1_completed = 0

COUNTER mission1_failed = 0

 

/////Vehicles///

CAR_DATA truck1

 

/////Phones////

OBJ_DATA phone01 = (82.7,148.25) 090 GREEN_PHONE

 

///Arrows//

ARROW_DATA ar1

ARROW_DATA ar2

ARROW_DATA ar3

ARROW_DATA ar4

 

LEVELSTART // -------------------------------------------------------------------------------------------------------------------------

 

mission1: //mission1 Label

IF (mission1_failed = 1) //The player failed the mission before.

SET mission1_failed = 0

ENDIF

ANSWER_PHONE ( boy , phone01 , 2000 )

POINT_ARROW_AT ( ar1, phone01 )

 

WHILE_EXEC (onmission1 = 0) // He didn't answer the phone yet

 

IF (CHECK_ANSWERED_PHONE(phone01)) //If he answer the phone

REMOVE_ARROW (ar1)

STOP_PHONE ( phone01 )

CLEAR_ALL_BRIEFS ( )

DISPLAY_BRIEF (1020) // Hello .....

SET onmission1 = 2 //This means he will be now doing that mission

truck1 = CREATE_CAR ( 84.7,149.8,2.0 ) 23 090 TRUKCAB2 TRUKTRNS END //It's the truck who i must get in

ENDIF

 

IF ( ( CHECK_FAIL_PHONE_TIMER(phone01 )) //Did not answer the phone on the time

AND ( mission1_failed = 0 ))

SET mission1_failed = 1

STOP_PHONE ( phone01 )

REMOVE_ARROW (ar1)

CLEAR_ALL_BRIEFS ( )

DISPLAY_MESSAGE (3730)//You have failed the mission ...

GOSUB mission1:

ENDIF

ENDWHILE

 

LEVELEND

Link to comment
Share on other sites

Andrew_Thiago

For GOD SAKE you're the man!! heh thank you so much!!! Now i guess i can go on!hehehe

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.