CLEO Help PUT WEAPON IN THE HAND

CLEO related
Status
Not open for further replies.

kakaka

Active member
Joined
Jun 7, 2014
Messages
59
Reaction score
0
how to put weapon in the hand.

if i have 1 m4,desert mp5,and want when 1 press 1 key,change to other weapon.

Example: i in the car with mp5,and when 1 press,change for m4 or ak47
thanks.
 

MaryKate

Active member
Joined
Feb 7, 2014
Messages
28
Reaction score
0
Code:
:pistol
wait 0
if 
0AB0:   key_pressed 49
jf @pistol
04B8: get_weapon_data_from_actor $PLAYER_ACTOR slot 3 weapon 1@ ammo 2@ model 3@
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 1@

just a quick example, if you press "1" you will switch to whatever pistol you have, think that's what you mean anyways
 

kakaka

Active member
Joined
Jun 7, 2014
Messages
59
Reaction score
0
Steezus link said:
Code:
:pistol
wait 0
if 
0AB0:   key_pressed 49
jf @pistol
04B8: get_weapon_data_from_actor $PLAYER_ACTOR slot 3 weapon 1@ ammo 2@ model 3@
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 1@

just a quick example, if you press "1" you will switch to whatever pistol you have, think that's what you mean anyways

Thanks =D
but when i enter passenger vehicle and try change,he dont change in vehicle,exist one metod to do ?
 

MaryKate

Active member
Joined
Feb 7, 2014
Messages
28
Reaction score
0
you might be able to do it with nop patches or you could teleport your player

Code:
:pistol
wait 0
if and 
0AB0:   key_pressed 49
0449:   actor $PLAYER_ACTOR in_a_car
jf @pistol
03C0: 30@ = actor $PLAYER_ACTOR car
04B8: get_weapon_data_from_actor $PLAYER_ACTOR slot 3 weapon 1@ ammo 2@ model 3@
0407: store_coords_to 4@ 5@ 6@ from_car 30@ with_offset 0.0 0.0 1.0
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 4@ 5@ 6@
01B9: set_actor $PLAYER_ACTOR armed_weapon_to 1@
wait 5
0430: put_actor $PLAYER_ACTOR into_car 30@ passenger_seat 0

when in a car and have pressed "1" this will quickly place the player outside the car change his weapon to whatever is in the pistol slot then place him back in the front passenger seat
 

MaryKate

Active member
Joined
Feb 7, 2014
Messages
28
Reaction score
0
Pressing
1 = changes to pistol
2 = changes to shotgun
3 = changes to submachine gun (uzi etc)
4 = changes to Assault rifle (m4 etc)
5 = changes to rifle (sniper etc)

Just open it and change whatever you want, presume it will only work if you're in the front passenger seat but haven't tested it so who knows
 

Attachments

  • CarWeapChange.cs
    20.2 KB · Views: 61
Status
Not open for further replies.
Top