Quantcast

Jump to content

» «
Photo

Every Mission i make crashes the Game.

4 replies to this topic
Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#1

Posted 10 May 2014 - 04:09 PM Edited by Maro Hannover, 10 May 2014 - 04:12 PM.

Hi i have Learnt SCM Coding and every mission i make crashes the game. i feel there is a problem with me i everytime went through the tutoriols again and again. Now i made a mission. But when i go to the trigger the $ONMISSION == 1 code starts but nothing happen then i figured that i forgot to rename the mission file. then i have corrected the mistake then i enter the mission the Game Crashes

Here is the code of my Mission

{$CLEO .cm}
 
:MissionStart
03A4: name_thread "TEST"  
gosub @MissionBegin
if
    wasted_or_busted
then
    gosub @MissionFailed
end
gosub @MissionCleanup
end_thread
 
:MissionBegin
wait 100
0247: load_model #CELLPHONE
038B: load_requested_models
if
0248:   model #CELLPHONE available
004D: jump_if_false @MIssionBegin
wait 1000                                                            
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
00BB: show_text_lowpriority GXT 'TXT02' time 3000 flag 1   //F: Hi Carl I got a job for you
wait 3000
00BC: show_text_highpriority GXT 'TXT03' time 2000 flag 1  //CJ: What is it Franklin?
wait 2000
00BB: show_text_lowpriority GXT 'TXT04' time 3000 flag 1   //F: There is a Corrupt Cop at AShospital go and Kill him.
wait 3000
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
0247: load_model #LAPD1
0247: load_model #COPCARLA
0247: load_model #DESERT_EAGLE
if
0248:   model #LAPD1 available
0248:   model #COPCARLA available
0248:   model #DESERT_EAGLE available
jf @MissionFailed
00A5: 1@ = create_car #COPCARLA at 1140.2621 -1340.9778 13.6631
0229: set_car 1@ primary_color_to 2 secondary_color_to 1
0674: set_car_model 1@ numberplate "Corrupt"
0129: 2@ = create_actor_pedtype 23 model #LAPD1 in_car 1@ driverseat
01B2: give_actor 2@ weapon 24 ammo 60 // Load the weapon model before using this
02A7: 3@ = create_icon_marker_and_sphere 20 at 1215.6962 -1391.8594 13.2972
if
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1215.6962 -1391.8594 13.2972 radius 80.0 80.0
Marker.Disable(3@)
jf @MissionFailed
00BB: show_text_lowpriority GXT 'TXT05' time 10000 flag 1  // Find a car in 20 secs or mission failed.already have? wait in your car 
wait 20000
if
0449: actor $PLAYER_ACTOR in_a_car
jf @MissionFailed
00BB: show_text_lowpriority GXT 'TXT06' time 10000 flag 1 //Where is that Bitch
02A7: 4@ = create_icon_marker_and_sphere 0 at 1143.7336 -1392.3125 13.5966
repeat until 
0100:   actor $PLAYER_ACTOR in_sphere 1143.7336 -1392.3125 13.5966 4.0 4.0 4.0 sphere 1 in_car
Marker.Disable(4@)
0187: 5@ = create_marker_above_actor 2@
00BB: show_text_lowpriority GXT 'TXT07' time 3000 flag 1 //The Cop is there chase him.don't kill him
00AD: set_car 1@ max_speed_to 20.0
00AE: unknown_set_car 1@ to_ignore_traffic_lights  2
00A7: car 1@ drive_to 1149.6721 -1224.9967 17.4142
repeat until
01AD:   car 1@ sphere 0 near_point 1149.6721 -1224.9967 17.4142 radius 6.0 6.0
0633: AS_actor 2@ exit_car
Actor.Health(2@)=250
02E2: set_actor 2@ weapon_accuracy_to 75
05E2: AS_actor 2@ kill_actor $PLAYER_ACTOR
00BB: show_text_lowpriority GXT 'TXT08' time 3000 flag 1  //The +r+Cop+w+ is out of his car kill him
repeat until
0118:   actor 2@ dead
Marker.Disable(5@)
0729: AS_actor $PLAYER_ACTOR hold_cellphone 1
00BB: show_text_lowpriority GXT 'TXT09' time 3000 flag 1  //CJ: Franklin. The Cop is dead.
wait 3000
00BC: show_text_highpriority GXT 'TXT10' time 3000 flag 1  //F: i am sending you the money on your bank account.
0729: AS_actor $PLAYER_ACTOR hold_cellphone 0
00BA: show_text_styled GXT "TXT11" time 2000 style 2  // Reward 10000$
0109: player $PLAYER_CHAR money += 10000
wait 2000
return
 
:MissionFailed
wait 100
00BA: show_text_styled GXT "TXT01" time 1000 style 2  // Mission Failed
return
 
:MissionCleanup
wait 100
Car.RemoveReferences(1@)
Actor.RemoveReferences(2@)
0249: release_model #CELLPHONE
0249: release_model #DESERT_EAGLE
0249: release_model #LAPD1
0249: release_model #COPCARLA
$ONMISSION = 0
mission_cleanup
return

end_thread

Ashwin.Star
  • Ashwin.Star

    i'll be back...

  • Members
  • Joined: 14 Nov 2010
  • India

#2

Posted 10 May 2014 - 04:24 PM Edited by Ashwin.Star, 10 May 2014 - 04:31 PM.

you forgot to load requested Models here

0247: load_model #LAPD1
0247: load_model #COPCARLA
0247: load_model #DESERT_EAGLE
//<----- here --------->//
if
0248:   model #LAPD1 available
0248:   model #COPCARLA available
0248:   model #DESERT_EAGLE available
jf @MissionFailed 

And, Why failing this mission if models are not available ????

that's not player's fault,

 

i found this as the main reason of Crash,

think if models are not available,

then mission is failed,

it's okay

thenin cleaning up the process,

-------------

wait 100
Car.RemoveReferences(1@)
Actor.RemoveReferences(2@)

------------

you have not created any car or any actor, during this run,

So 1@ & 2@ are not handles of any car or actor,

that makes the crash i think. 

----------------

ALSO,

Stop making jump to missionFail label,

is player in not in car or in sphere,

just make a loop there,

--------------


Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#3

Posted 11 May 2014 - 12:00 PM

you forgot to load requested Models here

0247: load_model #LAPD1
0247: load_model #COPCARLA
0247: load_model #DESERT_EAGLE
//<----- here --------->//
if
0248:   model #LAPD1 available
0248:   model #COPCARLA available
0248:   model #DESERT_EAGLE available
jf @MissionFailed 

And, Why failing this mission if models are not available ????

that's not player's fault,

 

i found this as the main reason of Crash,

think if models are not available,

then mission is failed,

it's okay

thenin cleaning up the process,

-------------

wait 100
Car.RemoveReferences(1@)
Actor.RemoveReferences(2@)

------------

you have not created any car or any actor, during this run,

So 1@ & 2@ are not handles of any car or actor,

that makes the crash i think. 

----------------

ALSO,

Stop making jump to missionFail label,

is player in not in car or in sphere,

just make a loop there,

--------------

Ok Indian Man but i want to know my learning mistake every single mission i make crashes


Silent
  • Silent

    Chief Fixing Officer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#4

Posted 11 May 2014 - 12:22 PM

00A5: 1@ = create_car #COPCARLA at 1140.2621 -1340.9778 13.6631
0229: set_car 1@ primary_color_to 2 secondary_color_to 1
0674: set_car_model 1@ numberplate "Corrupt"
0674 takes a model name as a parameter and the string HAS to be 8 chars long, so it should look like this:

0674: set_car_model #COPCARLA numberplate "CORRUPT_"
00A5: 1@ = create_car #COPCARLA at 1140.2621 -1340.9778 13.6631
0229: set_car 1@ primary_color_to 2 secondary_color_to 1
Besides, Ashwin has a point, correct those mistakes before trying to proceed.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#5

Posted 11 May 2014 - 01:20 PM

you forgot to load requested Models here

0247: load_model #LAPD1
0247: load_model #COPCARLA
0247: load_model #DESERT_EAGLE
//<----- here --------->//
if
0248:   model #LAPD1 available
0248:   model #COPCARLA available
0248:   model #DESERT_EAGLE available
jf @MissionFailed 
And, Why failing this mission if models are not available ????
that's not player's fault,
 
i found this as the main reason of Crash,
think if models are not available,
then mission is failed,


Not true, read this: http://gtag.gtagamin...p?showtopic=483

Use 0248 to check models are loaded or 038B if you don't mind the game freezing while they load (obviously doesn't matter if the screen has faded).




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users