Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (84,895 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

Andrew_Thiago

A hard question about Gta 2 scripting :

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

Share this post


Link to post
Share on other sites
Sektor

++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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Sektor


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

Share this post


Link to post
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

Share this post


Link to post
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

×

Important Information

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