CLEO Help is_char_shooting $PLAYER_ACTOR

CLEO related
Status
Not open for further replies.

Grubitsh

Active member
Joined
Jul 28, 2014
Messages
104
Reaction score
0
Hi,

i would like to make a script that does something after a player just shot a bullet.

I use the function 02E0: is_char_shooting $PLAYER_ACTOR, in a if, like:

if
02E0: is_char_shooting $PLAYER_ACTOR
then
Blablablablabla
end


I don't know why, but this opcode doesn't work for me.
I putted a ** AD1: show_text_highpriority ** in my "IF" to see if the cleo goes in it, but it don't.

As any of you guys used 02E0: ? If yes, did you had some troubles with it ? How did you fix it ?
Is their ANY OTHER WAY to know if a player is shooting ? (expect the button pressed, because I want to know who is shoting on SAMP streamed player)
 

Grubitsh

Active member
Joined
Jul 28, 2014
Messages
104
Reaction score
0
I know but it doesn't work, so:

As any of you guys used 02E0: ? If yes, did you had some troubles with it ? How did you fix it ?
Is their ANY OTHER WAY to know if a player is shooting ? (expect the button pressed, because I want to know who is shoting on SAMP streamed player)
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Idk why it doesn't work for you but I tried TH3RM4L's way and it works for me using Cleo 4.1, Mg funcs 4.3, sampfucs 4.0, samp client 0.3z R1

I used the following code:
Code:
{$CLEO .cs}
0000: NOP 

:first
wait 0
if
02E0:   actor $PLAYER_ACTOR firing_weapon
then
print "shooting" 100
end
jump @first


These can be helpful if you'd like to check if the bullet hits(not 100% accurate because it's clientside)
Code:
031D:   actor 1@ hit_by_weapon 28
051A:   actor 1@ damaged_by_actor 0@

054E: clear_actor 1@ damage 
0467: clear_actor 0@ last_weapon_damage
 

Grubitsh

Active member
Joined
Jul 28, 2014
Messages
104
Reaction score
0
Double post sorry.

I worked out with the memory to get the "weapon state" which says:

0=idle
1=firing
2=reload.

It works for 0 and 2, but not 1, (and I want the 1)

VIDEO click here

Any solution ?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Both fireState and opcode should work.
I'm pretty sure it actually shows 1, but using 0AD1 opcode with a high ms display will cause it be 0/2 all the time.
Try something like;

readMem/func 0@
IF 0@ == 1
THEN 0AF8: "ww"
END
 
Status
Not open for further replies.
Top