CLEO Help Masked Man Checker

CLEO related
Status
Not open for further replies.

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
This script is not working, i don't know why. I've try anything but, still not working. Please help me.
When I activated "MSK" then i go nearest player, and nothing happen.

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
wait 0
   SAMP.Available

:Noname_8
wait 0
if
0ADC:   test_cheat "MSK"
jf @Noname_164
if
  0@ == 1
jf @Noname_110
0@ = 0
printf "~r~OFF ~w~- Maskman Checker by Doublesix" 1000
goto @Noname_164

:Noname_110
0@ = 1
printf "~g~ON ~w~- Maskman Checker by Doublesix" 1000

:Noname_164
if
  0@ == 1   
jf @Noname_272
04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0             
if and
   SAMP.IsPlayerConnected(2@)
   not 1@ == -1
0AE1: 1@ = random_actor_near_point 5@ 6@ 7@ in_radius 10.0 find_next 0 pass_deads 0
jf @Noname_272
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
3@ = SAMP.GetPlayerNickname(2@)
printf "~w~Nickname: ~y~%s ~w~ID: ~y~%d" 5000 3@ 2@
wait 1000

:Noname_272
goto @Noname_8
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
someone correct me if I'm wrong but I see the following issues:

lack of "then" or "jf" after
Code:
if and
   SAMP.IsPlayerConnected(2@)
   not 1@ == -1

"jf" is there but after 0AE1 opcode, which actually sets 1@ to be an actor but after the 1@ is checked for -1 (which is PLAYER_ACTOR ? )
First it should be set, then it should be checked. There is no notification about PLAYER_ACTOR being randomly chosen (and ignored) so that could be one of the reasons why nothing happens when you activate it.

Shouldn't this line/function be used as a condition?
Code:
SAMP.Available

Idk if it does what is expected and I'm just not aware of sanny builder syntax (is indentation used for condition of "if" statement when cleo is decompiled?) but you could use something like this:
Code:
repeat
    wait 50
until 0AFA:  is_samp_available

The idea of getting random actor makes the mod rely on luck, I think it would be better to use targeted actor using this snippet:
http://ugbase.eu/index.php?threads/snippet-get_target_actor.7098/

Btw don't you think that using labels with numbers left after decompiling some other mod (or did you decompile your own mod?) is not very readable and just adds to confusion?
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
someone correct me if I'm wrong but I see the following issues:

lack of "then" or "jf" after
Code:
if and
   SAMP.IsPlayerConnected(2@)
   not 1@ == -1

"jf" is there but after 0AE1 opcode, which actually sets 1@ to be an actor but after the 1@ is checked for -1 (which is PLAYER_ACTOR ? )
First it should be set, then it should be checked. There is no notification about PLAYER_ACTOR being randomly chosen (and ignored) so that could be one of the reasons why nothing happens when you activate it.

Shouldn't this line/function be used as a condition?
Code:
SAMP.Available

Idk if it does what is expected and I'm just not aware of sanny builder syntax (is indentation used for condition of "if" statement when cleo is decompiled?) but you could use something like this:
Code:
repeat
    wait 50
until 0AFA:  is_samp_available

The idea of getting random actor makes the mod rely on luck, I think it would be better to use targeted actor using this snippet:
http://ugbase.eu/index.php?threads/snippet-get_target_actor.7098/

Btw don't you think that using labels with numbers left after decompiling some other mod (or did you decompile your own mod?) is not very readable and just adds to confusion?

If i use targeted actor, it will be complicated. I can't check any masked man if distance too far away.

About 1@ is checked for -1 (its mean BOT i guess) so this mod can't detected any nearest BOT, it's only detected real Player.

Actually, i've no problem with this function /SAMP.Available/ it's still work when i use that for /targeted actor/

someone correct me if I'm wrong but I see the following issues:

lack of "then" or "jf" after
Code:
if and
   SAMP.IsPlayerConnected(2@)
   not 1@ == -1

"jf" is there but after 0AE1 opcode, which actually sets 1@ to be an actor but after the 1@ is checked for -1 (which is PLAYER_ACTOR ? )
First it should be set, then it should be checked. There is no notification about PLAYER_ACTOR being randomly chosen (and ignored) so that could be one of the reasons why nothing happens when you activate it.

Shouldn't this line/function be used as a condition?
Code:
SAMP.Available

Idk if it does what is expected and I'm just not aware of sanny builder syntax (is indentation used for condition of "if" statement when cleo is decompiled?) but you could use something like this:
Code:
repeat
    wait 50
until 0AFA:  is_samp_available

Did you mean like this?

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
wait 0
repeat
    wait 50
until 0AFA:  is_samp_available

:Noname_8
wait 0
if
0ADC:   test_cheat "MSK"
jf @Noname_164
if
  0@ == 1
jf @Noname_110
0@ = 0
printf "~r~OFF ~w~- Maskman Checker by Doublesix" 1000
goto @Noname_164

:Noname_110
0@ = 1
printf "~g~ON ~w~- Maskman Checker by Doublesix" 1000

:Noname_164
if
  0@ == 1  
04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0            
if and
   SAMP.IsPlayerConnected(2@)
   not 1@ == -1
0AE1: 1@ = random_actor_near_point 5@ 6@ 7@ in_radius 10.0 find_next 0 pass_deads 0
jf @Noname_272
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
3@ = SAMP.GetPlayerNickname(2@)
printf "~w~Nickname: ~y~%s ~w~ID: ~y~%d" 5000 3@ 2@
wait 1000

:Noname_272
goto @Noname_8
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
If i use targeted actor, it will be complicated. I can't check any masked man if distance too far away.
why is that? Aren't nametags working properly on the server you are playing?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
but I mean nametag hacks (not normal nametags that you get without any mods), aren't these working properly?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
did you check the snippet I referenced?
and why do you think that it will not work when the player is too far?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
I more confused with that code bro, haha. Seriously

You can try this code...

PHP:
{$CLEO .cs}

0000: NOP
 
REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY


WHILE TRUE
    WAIT 0
     
IF
056D:   actor $PLAYER_ACTOR defined
THEN
// GET ALL STREAMED PEDS    
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@
            IF AND
            803B:   31@ == $PLAYER_ACTOR  // (int)
            056D:   actor 31@ defined
            THEN
                0B2B: samp 0@ = get_player_id_by_actor_handle 31@
                0B36: samp 10@ = get_player_nickname 0@
                00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
                00A0: store_actor 31@ position_to 4@ 5@ 6@
                0509: 7@ = distance_between_XY 1@ 2@ and_XY 4@ 5@
                IF
                7@ <= 1.0 /// You can set distance here, max is 300.0(Float)
                THEN
                    Printf "ID: %d Nick: %s" 5000 0@ 10@
                END
           END
       END
   END
END

END
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
there are 2 code containers in that post, the big one just has to be copied and appended at the end of your code. The small one is how you actually use it which is very simple:

IF
0AB1: @GET_TARGET_ACTOR 0 0@
THEN
// 0@ is the actor
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0

END
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
You can try this code...

PHP:
{$CLEO .cs}

0000: NOP

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY


WHILE TRUE
    WAIT 0
    
IF
056D:   actor $PLAYER_ACTOR defined
THEN
// GET ALL STREAMED PEDS   
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@
            IF AND
            803B:   31@ == $PLAYER_ACTOR  // (int)
            056D:   actor 31@ defined
            THEN
                0B2B: samp 0@ = get_player_id_by_actor_handle 31@
                0B36: samp 10@ = get_player_nickname 0@
                00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
                00A0: store_actor 31@ position_to 4@ 5@ 6@
                0509: 7@ = distance_between_XY 1@ 2@ and_XY 4@ 5@
                IF
                7@ <= 1.0 /// You can set distance here, max is 300.0(Float)
                THEN
                    Printf "ID: %d Nick: %s" 5000 0@ 10@
                END
           END
       END
   END
END

END
not work, crash bro. but thanks a lot.
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
there are 2 code containers in that post, the big one just has to be copied and appended at the end of your code. The small one is how you actually use it which is very simple:
Did you mean like this?

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
wait 0

:Noname_6
wait 50
   SAMP.Available
jf @Noname_6

:Noname_19
wait 0
if
0ADC:   test_cheat "MSK"
jf @Noname_175
if
  0@ == 1
jf @Noname_121
0@ = 0
printf "~r~OFF ~w~- Maskman Checker by Doublesix" 1000
goto @Noname_175

:Noname_121
0@ = 1
printf "~g~ON ~w~- Maskman Checker by Doublesix" 1000

:Noname_175
if
  0@ == 1
if and
   SAMP.IsPlayerConnected(2@)
   not 1@ == -1
0AE1: 1@ = random_actor_near_point 6@ 7@ 8@ in_radius 10.0 find_next 0 pass_deads 0 //IF and SET
jf @Noname_327
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
3@ = SAMP.GetPlayerNickname(2@)
printf "~w~Nickname: ~y~%s ~w~ID: ~y~%d" 5000 3@ 2@
wait 1000

:Noname_327
IF
0AB1: @Noname_175 0 5@
THEN
// 0@ is the actor
04C4: store_coords_to 6@ 7@ 8@ from_actor 5@ with_offset 0.0 0.0 0.0
END
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,112
Solutions
5
Reaction score
878
Location
Lithuania
0.3.7 bro

PHP:
{$CLEO .cs}

0000: NOP

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY


WHILE TRUE
    WAIT 0
   
IF
056D:   actor $PLAYER_ACTOR defined
THEN
wait 0
// GET ALL STREAMED PEDS  
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@
            IF AND
            803B:   31@ == $PLAYER_ACTOR  // (int)
            056D:   actor 31@ defined
            THEN
                0B2B: samp 0@ = get_player_id_by_actor_handle 31@
                0B36: samp 10@ = get_player_nickname 0@
                00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
                00A0: store_actor 31@ position_to 4@ 5@ 6@
                0509: 7@ = distance_between_XY 1@ 2@ and_XY 4@ 5@
                IF
                7@ <= 1.0 /// You can set distance here, max is 300.0(Float)
                THEN
                    Printf "ID: %d Nick: %s" 5000 0@ 10@
                END
           END
       END
   END
END

END
 

Attachments

  • sa-mp-038.png
    sa-mp-038.png
    452.8 KB · Views: 19
Status
Not open for further replies.
Top