Jump to content

[SA] Throw explosive homing beach ball help


Recommended Posts

Ok so i want to make this mod where you get a beach ball and you throw it and it automatically throws it to the nearest ped like a heat seeking missile but it wont throw it just bugs and i dont know how to make it explode on impact any help?

 

CODE :

{$CLEO .cs}THREAD 'BEACHBALLBOMB':BALLZwait 0if and0ADC:   test_cheat "BEACH"044B:   actor $PLAYER_ACTOR on_footjf @BALLZjump @START:STARTobject.Create(0@,1598,0,0,0)01B9: set_actor $PLAYER_ACTOR armed_weapon_to 00992: set_player $PLAYER_CHAR weapons_scrollable 0070A: AS_actor $PLAYER_ACTOR attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 104ED: load_animation  "GRENADE"jump @THROW:THROWwait 0if and0AB0:   key_pressed 104EE:   animation "GRENADE" loadedjf @THROW018C: play_sound 1052 at 0.0 0.0 0.00AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 21@ closest_ped_to 1@04C4: store_coords_to 2@ 3@ 4@ from_actor 1@ with_offset 1.0 3.0 1.00812: AS_actor $PLAYER_ACTOR perform_animation "WEAPON_throw" IFP "GRENADE" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1  // versionB0682: detach_object 0@ 0.0 0.0 0.0 collision_detection 0object.ToggleInMovingList(0@,1)object.Throw(0@,2@,3@,4@)object.StorePos(0@,10@,11@,12@)object.PutAt(0@,10@,11@,12@)jump @IMPACTCHECK:IMPACTCHECKwait 0ifobject.CollisionDetection(0@,1)jf @IMPACTCHECKobject.StorePos(0@,10@,11@,12@)020C: create_explosion_with_radius 0 at 10@ 11@ 12@jump @START:DEACTWAITwait 0if0ADC:   test_cheat "BEACH"jf @DEACTWAIT
Link to comment
https://gtaforums.com/topic/771177-sa-throw-explosive-homing-beach-ball-help/
Share on other sites

{$CLEO .cs}

 

THREAD 'BEACHBALLBOMB'

 

 

:BALLZ

wait 0

if and

0ADC: test_cheat "BEACH"

044B: actor $PLAYER_ACTOR on_foot

jf @BALLZ

jump @START

 

 

 

 

 

:START

wait 0

object.Create(0@,1598,0,0,0)

01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0

0992: set_player $PLAYER_CHAR weapons_scrollable 0

070A: AS_actor $PLAYER_ACTOR attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 1

04ED: load_animation "GRENADE"

 

 

 

:THROW

wait 0

if and

0AB0: key_pressed 1

04EE: animation "GRENADE" loaded

jf @THROW

018C: play_sound 1052 at 0.0 0.0 0.0

//0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 21@ closest_ped_to 1@

//04C4: store_coords_to 2@ 3@ 4@ from_actor 1@ with_offset 1.0 3.0 1.0

 

04C4: store_coords_to 2@ 3@ 4@ from_actor $PLAYER_ACTOR with_offset 0.5 1.5 0.6

5@ = Actor.Angle($PLAYER_ACTOR)

02F6: 7@ = sine 5@ // (float)

02F7: 8@ = cosine 5@ // (float)

7@ *= -20.0

8@ *= 20.0

0812: AS_actor $PLAYER_ACTOR perform_animation "WEAPON_throw" IFP "GRENADE" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -1 // versionB

wait 250

0682: detach_object 0@ 0.0 0.0 0.0 collision_detection 1

//detach don't work for me, so destroy and create new beachball

Object.Destroy(0@)

object.Create(0@,1598,0,0,0)

object.PutAt(0@,2@,3@,4@)

04D9: object 0@ set_scripted_collision_check 1

Object.CollisionDetection(0@) = True

0906: set_object 0@ mass_to 300.0 // float

0908: set_object 0@ turn_mass_to 300.0 // float

object.ToggleInMovingList(0@,1)

object.Throw(0@,7@,8@,5.0)

 

jump @IMPACTCHECK

 

 

:IMPACTCHECK

wait 0

if

04DA: has_object 0@ collided

jf @IMPACTCHECK

object.StorePos(0@,10@,11@,12@)

020C: create_explosion_with_radius 0 at 10@ 11@ 12@

Object.Destroy(0@)

jump @START

 

 

 

 

 

:DEACTWAIT

wait 0

if

0ADC: test_cheat "BEACH"

jf @DEACTWAIT

look here for more infos Edited by ZAZ

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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