CLEO Help script to jump to the specified ammo slot

CLEO related
Status
Not open for further replies.

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
Hi, I need a script when when I press P I switch to ammo slot 3, regardless of whether I am sitting in a vehicle or a pedestrian.
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Hi, I need a script when when I press P I switch to ammo slot 3, regardless of whether I am sitting in a vehicle or a pedestrian.
Requires SAMPFUNCS and SAMP 0.3.7 R1
Code:
{$CLEO}
0000: Auto Weapon Slot 3 by ajom

repeat
    wait 0
until 0AFA:  is_samp_available

while true
    wait 0
    if and
        8B21: not samp is_chat_opened
        0ADC: test_cheat "P"
    then
        04B8: get_weapon_data_from_actor $PLAYER_ACTOR slot 3 weapon 0@ ammo 1@ model 2@
        if 1@ > 0 // has ammo
        then
                0A96: 2@ = actor $PLAYER_ACTOR struct
                0AA6: call_method 0x5E6280 struct 2@ params 1 pop 0 0@
        end
    end
end
 
Last edited:

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
Thank you, but it only works when I'm not in the vehicle, and I need it even when I'm a driver.

And if the script could be paused when writing to a chat or dialog table, it would be great.
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
Could you please make the script pause whenever I write to a chat or dialog table?

When the chat is simply open so that the script does not shuffle the weapon.
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
can you please modify this script for me so that when I have a chat turned on, the weapons are not shuffled, as you did above, but there are more slots, and would you not scratch it if I wanted to modify something or add a slot.
 

Attachments

  • switch.cs
    19.6 KB · Views: 5

TheDjCody

Active member
Joined
Sep 6, 2018
Messages
40
Reaction score
5
can you please modify this script for me so that when I have a chat turned on, the weapons are not shuffled, as you did above, but there are more slots, and would you not scratch it if I wanted to modify something or add a slot.

8B21: not samp is_chat_opened
 
Status
Not open for further replies.
Top