Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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

Car weapon problem


putraGTA
 Share

Recommended Posts

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.. sad.gif

Can anyone help to fix my problem?

I want to make likes twisted metal game.

Pleasse..,

Link to comment
Share on other sites

TheGodfather.

You have made a spelling mistake it should be coords instead of choords

Link to comment
Share on other sites

Now, I've change the mistake

but, it always crash my game when i'am press LCTRL or L button.. sad.gif

What is wrong with my script?

Link to comment
Share on other sites

@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

Michael-Knight1

 

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

 

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

Thank you, @Bad.Boy! smile.gif

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! smile.gif

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.