CLEO Help Taze nearby player is not working!!!

CLEO related
Status
Not open for further replies.

Supermacy31

Active member
Joined
Mar 13, 2013
Messages
173
Reaction score
0
I thought it should work but it doesn't work.

Code:
{$CLEO .cs}
0000:

:Main
wait 0
if and
056D: actor $PLAYER_ACTOR defined 
0AB0: key_pressed 101
jf @MAIN 
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D:  actor 1@ defined 
jf @Main
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0AF9: samp say_msg "/taze %d" 2@
wait 1000
jump @Main

What's wrong with it?

Pressing numberpad 5 does nothing right now.
 

Attachments

  • CnR.cs
    17.6 KB · Views: 31

Supermacy31

Active member
Joined
Mar 13, 2013
Messages
173
Reaction score
0
monday said:
maybe cnr server checks for the keys state

That's not the case. The cleo fails to check for nearby players. I tested it and it said "Player not available" or something in another cleo. It fails in checking for nearby players so is there a working method? This method was made/created in 2014 so it's been 2 years , the way that it checks for nearby players isn't working anymore. Can you help?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
you could check this code but there are 2 issues to it. It wasn't tested so there may be mistakes and if that 0AB5 opcode isn't working for you then God knows if bunch of other opcodes used below will work or not


Code:
{$CLEO .cs}
0000:

:Main
wait 0
if and
056D: actor $PLAYER_ACTOR defined 
0AB0: key_pressed 101
jf @MAIN 
00A0: store_actor $PLAYER_ACTOR position_to 3@ 4@ 5@
10@ = 100.0 //minimal distance
12@ = false //to check if there are any players around at all
 
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
        if and
        0029:  31@ >= 0x00 
        001B:  0x80 > 31@
        then 
        005A: 31@ += 30@
        00A0: store_actor 31@ position_to 6@ 7@ 8@
        050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
            if and
            0025:   10@ > 9@ 
            0021:   9@ > 0.2 //idk if it's neccessary but I remember having some weird problems without it while making other mod so 
            //if
            //0025:   10@ > 9@ 
            then
            0087: 10@ = 9@ // (float) to save the new closest distance found
            0085: 11@ = 31@ // (int) to save the new closest player found
            12@ = true
            end
        end
    end
    
if 12@ == true
jf @Main

2@ = SAMP.GetSAMPPlayerIDByActorHandle(11@)
0AF9: samp say_msg "/taze %d" 2@
wait 1000
jump @Main
 

Supermacy31

Active member
Joined
Mar 13, 2013
Messages
173
Reaction score
0
monday said:
you could check this code but there are 2 issues to it. It wasn't tested so there may be mistakes and if that 0AB5 opcode isn't working for you then God knows if bunch of other opcodes used below will work or not


Code:
{$CLEO .cs}
0000:

:Main
wait 0
if and
056D: actor $PLAYER_ACTOR defined 
0AB0: key_pressed 101
jf @MAIN 
00A0: store_actor $PLAYER_ACTOR position_to 3@ 4@ 5@
10@ = 100.0 //minimal distance
12@ = false //to check if there are any players around at all
 
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    for 30@ = 0 to 35584 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
        if and
        0029:  31@ >= 0x00 
        001B:  0x80 > 31@
        then 
        005A: 31@ += 30@
        00A0: store_actor 31@ position_to 6@ 7@ 8@
        050A: 9@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 6@ 7@ 8@
            if and
            0025:   10@ > 9@ 
            0021:   9@ > 0.2 //idk if it's neccessary but I remember having some weird problems without it while making other mod so 
            //if
            //0025:   10@ > 9@ 
            then
            0087: 10@ = 9@ // (float) to save the new closest distance found
            0085: 11@ = 31@ // (int) to save the new closest player found
            12@ = true
            end
        end
    end
    
if 12@ == true
jf @Main

2@ = SAMP.GetSAMPPlayerIDByActorHandle(11@)
0AF9: samp say_msg "/taze %d" 2@
wait 1000
jump @Main

Solved, fixes current issue. Thanks a lot!
 
Status
Not open for further replies.
Top