putraGTA Posted August 29, 2012 Share Posted August 29, 2012 I got problem with my script. In my script, that will spawn monster truck. When CJ drive the car and press L, it will launch missile, but if LCTRL is press, it will launch mechine gun. Here's my script : {$CLEO .cs} //----------MAIN---------- thread 'DARKTOOTH' :DARKTOOTH_DEFINED wait 0 if Player.Defined($Player_char) else_jump @DARKTOOTH_DEFINED if $ONMISSION == 0 else_jump @DARKTOOTH_DEFINED if 00FE: actor $Player_actor sphere 0 in_sphere -2873.478 80.2714 5.593277 radius 80.5 80.5 50.5 else_jump @DARKTOOTH_DEFINED Model.Load(#Monster) 038B: load_request_models :DARKTOOTH_CHECK wait 0 if Model.Available(#Monster) jf @DARKTOOTH_CHECK $monster = Car.Create(#Monster, -2873.478, 80.27142, 5.593277) Car.Angle($monster) = 249.3 Car.Health($monster) = 100000 $qcar = Marker.Createabovecar($monster) Marker.Setcolor($monster, 0) Car.Setmaxspeed($monster, 1000) 01EC: make_car $monster very_heavy 1 014B: $parked_monster = init parked car generator #Monster -1 -1 1 alarm 0 door lock 0 0 10000 at -2873.478 80.2714 5.593277 angle 249.3 014C: set_parked_car_generator $parked_monster cars_to_generate_to 101 053F: set_car $monster tires_vulnerability 1 :DARKTOOTH_WEAPON wait 0 if and 00DB: actnr $Player_actor in_car $monster 0AB0: key_pressed 17 else_jump @DARKTOOTH_WEAPON 0407: store_choords_to [email protected] [email protected] [email protected] from_car $monster with_offset 0.5 10.0 0.0 0407: store_choords_to [email protected] [email protected] [email protected] from_car $monster with_offset 0.5 100.0 0.0 06BC: create_M4_shoot_from [email protected] [email protected] [email protected] target [email protected] [email protected] [email protected] energy 1E24 :DARKTOOTH_GUN wait 0 if and 00DB: actor $Player_in_car $monster 0AB0: key_pressed 76 else_jump @DARKTOOTH_GUN 0407: store_choords_to [email protected] [email protected] [email protected] from_car $monster with_offset 0.5 10.0 0.0 0407: store_choords_to [email protected] [email protected] [email protected] from_car $monster with_offset 0.5 100.0 0.0 020C: create_explosion_of_type 6 at [email protected] [email protected] [email protected] :DARKTOOTH_UNLOAD Marker.Disable($qcar) Model.Destroy(#Monster) 0249: release_model $monster end_thread But, it crash my game.. Can anyone help to fix my problem? I want to make likes twisted metal game. Pleasse.., Link to comment Share on other sites More sharing options...
TheGodfather. Posted August 29, 2012 Share Posted August 29, 2012 You have made a spelling mistake it should be coords instead of choords Link to comment Share on other sites More sharing options...
putraGTA Posted August 29, 2012 Author Share Posted August 29, 2012 Now, I've change the mistake but, it always crash my game when i'am press LCTRL or L button.. What is wrong with my script? Link to comment Share on other sites More sharing options...
Bad.boy! Posted August 29, 2012 Share Posted August 29, 2012 @arijitsen It doesn't matter how you write opcodes, SB will compile "038B: load_request_models" the same as "038B: what_did_he_just_say" as long as the variables are good. These 2 do about the same thing, use only 1. 038B: load_request_modelsModel.Available(#Monster) Don't use globals, use locals ($monster). And if you don't know what opcodes do, don't use them: 014B: $parked_monster = init parked car generator #Monster -1 -1 1 alarm 0 door lock 0 0 10000 at -2873.478 80.2714 5.593277 angle 249.3014C: set_parked_car_generator $parked_monster cars_to_generate_to 101 What is this supposed to be? 00DB: actor $Player_in_car $monster And the whole structure of your code is wrong, try to think about how the game is going to read it and what you actually want to make happen. Link to comment Share on other sites More sharing options...
putraGTA Posted August 29, 2012 Author Share Posted August 29, 2012 @Bad.Boy, did you mean I must remove that opcode? And add if actor.Driving($player.Actor) Link to comment Share on other sites More sharing options...
putraGTA Posted August 30, 2012 Author Share Posted August 30, 2012 Man., what's wrong with my script? Anyone can help me? Link to comment Share on other sites More sharing options...
ZAZ Posted August 30, 2012 Share Posted August 30, 2012 Man., what's wrong with my script?Anyone can help me? answer Bad.boy!'s question: What is this supposed to be? 00DB: actor $Player_in_car $monster read tutorial CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted August 31, 2012 Share Posted August 31, 2012 Man., what's wrong with my script?Anyone can help me? when you create script by your own , you can to fix it . Sorry but i'am sure it's other modder script . What is this supposed to be? 00DB: actor $Player_in_car $monster Link to comment Share on other sites More sharing options...
Bad.boy! Posted August 31, 2012 Share Posted August 31, 2012 when you create script by your own , you can to fix it .Sorry but i'am sure it's other modder script . What the hell is your problem? No one would post a code that bad, for people to copy/use. He obviously didn't copy it. And please stop posting, because most of the time you are wrong, or you simply post spam like this. Now to keep this on topic: {$CLEO .cs}:DARKTOOTH_DEFINEDwait 0if and // If and doesn't hurt anybodyPlayer.Defined($PLAYER_CHAR)$ONMISSION == 000FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2873.478 80.2714 5.593277 radius 80.5 80.5 50.5jf @DARKTOOTH_DEFINEDModel.Load(#Monster)038B: load_request_models// [email protected] = Car.Create(#Monster, -2873.478, 80.27142, 5.593277)Car.Angle([email protected]) = 249.3Car.Health([email protected]) = [email protected] = Marker.Createabovecar([email protected])Marker.Setcolor([email protected], 0)01EC: make_car [email protected] very_heavy 1053F: set_car [email protected] tires_vulnerability 10249: release_model #MONSTER // We don't need it anymore// First the game will check if the player pressed key 17. Then it will check if the player pressed key 76.// If that's not the case, the game is going to check if the player is actually in the car, if not the car is destroyed.// If the player is still in the car, the game will start again checking the keys and so on. :GUNwait 0if and00DB: actor $PLAYER_ACTOR in_car [email protected]: key_pressed 17else_jump @EXPLOSION0407: store_choords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.5 10.0 0.00407: store_choords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.5 100.0 0.006BC: create_M4_shoot_from [email protected] [email protected] [email protected] target [email protected] [email protected] [email protected] energy 0x1E24 // I don't know what you mean with 1E24, so I assume it's hex:EXPLOSIONwait 0if and00DB: actor $PLAYER_ACTOR in_car [email protected]: key_pressed 76else_jump @INCAR0407: store_choords_to [email protected] [email protected] [email protected] from_car $monster with_offset 0.5 100.0 0.0020C: create_explosion_of_type 6 at [email protected] [email protected] [email protected]:INCARwait 0if80DB: not actor $PLAYER_ACTOR in_car [email protected] @GUNCar.Destroy([email protected])Marker.Disable([email protected])jump @DARKTOOTH_DEFINED Link to comment Share on other sites More sharing options...
putraGTA Posted August 31, 2012 Author Share Posted August 31, 2012 Thank you, @Bad.Boy! Now I'am start understanding when you write that. I'am sorry, because I'am beginner so I dont know what the function of the opcode. Thank's a lot @Bad.Boy! You help a lot, You're great! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now