IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Car weapon problem

 Special weapon
 
putraGTA  
Posted: Wednesday, Aug 29 2012, 13:26
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



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 1@ 2@ 3@ from_car $monster with_offset 0.5 10.0 0.0
0407: store_choords_to 4@ 5@ 6@ from_car $monster with_offset 0.5 100.0 0.0
06BC: create_M4_shoot_from 1@ 2@ 3@ target 4@ 5@ 6@ 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 1@ 2@ 3@ from_car $monster with_offset 0.5 10.0 0.0
0407: store_choords_to 4@ 5@ 6@ from_car $monster with_offset 0.5 100.0 0.0
020C: create_explosion_of_type 6 at 4@ 5@ 6@

: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..,
PM
  Top
 

 
arijitsen  
Posted: Wednesday, Aug 29 2012, 14:35
Quote Post


It's show time
Group Icon
Group: Members
Joined: Jun 19, 2012

ia.gif

XXXXX



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

 
putraGTA  
Posted: Wednesday, Aug 29 2012, 15:03
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



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?
PM
  Top
 

 
Bad.boy!  
Posted: Wednesday, Aug 29 2012, 15:04
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



@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.
CODE
038B: load_request_models
Model.Available(#Monster)


Don't use globals, use locals ($monster). And if you don't know what opcodes do, don't use them:
CODE
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


What is this supposed to be?
CODE
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.
PM
  Top
 

 
putraGTA  
Posted: Wednesday, Aug 29 2012, 15:30
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



@Bad.Boy, did you mean I must remove that opcode?
And add if actor.Driving($player.Actor)
PM
  Top
 

 
putraGTA  
Posted: Thursday, Aug 30 2012, 16:36
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



Man., what's wrong with my script?
Anyone can help me?
PM
  Top
 

 
ZAZ  
Posted: Thursday, Aug 30 2012, 19:20
Quote Post


Kernlochbohrer
Group Icon
Group: Members
Joined: Jan 10, 2005

eu.gif

Member Award




QUOTE (putraGTA @ Thursday, Aug 30 2012, 17:36)
Man., what's wrong with my script?
Anyone can help me?

answer Bad.boy!'s question:
QUOTE
What is this supposed to be?

CODE
00DB: actor $Player_in_car $monster


read tutorial
Users WebsitePM
  Top
 

 
Michael-Knight1  
Posted: Friday, Aug 31 2012, 19:01
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



QUOTE (putraGTA @ Thursday, Aug 30 2012, 16:36)
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 .

QUOTE

What is this supposed to be?

CODE

00DB: actor $Player_in_car $monster

Users WebsitePM
  Top
 

 
Bad.boy!  
Posted: Friday, Aug 31 2012, 20:58
Quote Post


SA modder
Group Icon
Group: Members
Joined: Jun 20, 2010

nl.gif

XXXXX



QUOTE (Michael-Knight1 @ Friday, Aug 31 2012, 21:01)
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:
CODE
{$CLEO .cs}

:DARKTOOTH_DEFINED
wait 0
if and  // If and doesn't hurt anybody
Player.Defined($PLAYER_CHAR)
$ONMISSION == 0
00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2873.478 80.2714 5.593277 radius 80.5 80.5 50.5
jf @DARKTOOTH_DEFINED
Model.Load(#Monster)
038B: load_request_models

// Spawn
0@ = Car.Create(#Monster, -2873.478, 80.27142, 5.593277)
Car.Angle(0@) = 249.3
Car.Health(0@) = 100000
1@ = Marker.Createabovecar(0@)
Marker.Setcolor(1@, 0)
01EC: make_car 0@ very_heavy 1
053F: set_car 0@ tires_vulnerability 1
0249: 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.
:GUN
wait 0
if and
00DB: actor $PLAYER_ACTOR in_car 0@
0AB0: key_pressed 17
else_jump @EXPLOSION
0407: store_choords_to 2@ 3@ 4@ from_car 0@ with_offset 0.5 10.0 0.0
0407: store_choords_to 5@ 6@ 7@ from_car 0@ with_offset 0.5 100.0 0.0
06BC: create_M4_shoot_from 2@ 3@ 4@ target 5@ 6@ 7@ energy 0x1E24 // I don't know what you mean with 1E24, so I assume it's hex

:EXPLOSION
wait 0
if and
00DB: actor $PLAYER_ACTOR in_car 0@
0AB0: key_pressed 76
else_jump @INCAR
0407: store_choords_to 5@ 6@ 7@ from_car $monster with_offset 0.5 100.0 0.0
020C: create_explosion_of_type 6 at 5@ 6@ 7@

:INCAR
wait 0
if
80DB: not actor $PLAYER_ACTOR in_car 0@
jf @GUN
Car.Destroy(0@)
Marker.Disable(1@)
jump @DARKTOOTH_DEFINED
PM
  Top
 

 
putraGTA  
Posted: Friday, Aug 31 2012, 23:59
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 29, 2012

XXXXX



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
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG