Help Masked Man Checker

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#1
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
  [email protected] == 1
jf @Noname_110
[email protected] = 0
printf "~r~OFF ~w~- Maskman Checker by Doublesix" 1000
goto @Noname_164

:Noname_110
[email protected] = 1
printf "~g~ON ~w~- Maskman Checker by Doublesix" 1000

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

:Noname_272
goto @Noname_8
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
961
Likes
23
Points
68
#2
someone correct me if I'm wrong but I see the following issues:

lack of "then" or "jf" after
Code:
if and
   SAMP.IsPlayerConnected([email protected])
   not [email protected] == -1
"jf" is there but after 0AE1 opcode, which actually sets [email protected] to be an actor but after the [email protected] 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?
 
OP
OP
Doublesix

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#3
someone correct me if I'm wrong but I see the following issues:

lack of "then" or "jf" after
Code:
if and
   SAMP.IsPlayerConnected([email protected])
   not [email protected] == -1
"jf" is there but after 0AE1 opcode, which actually sets [email protected] to be an actor but after the [email protected] 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 [email protected] 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([email protected])
   not [email protected] == -1
"jf" is there but after 0AE1 opcode, which actually sets [email protected] to be an actor but after the [email protected] 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
  [email protected] == 1
jf @Noname_110
[email protected] = 0
printf "~r~OFF ~w~- Maskman Checker by Doublesix" 1000
goto @Noname_164

:Noname_110
[email protected] = 1
printf "~g~ON ~w~- Maskman Checker by Doublesix" 1000

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

:Noname_272
goto @Noname_8
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
961
Likes
23
Points
68
#4
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

Well-Known Member
Joined
Jun 23, 2014
Messages
961
Likes
23
Points
68
#6
but I mean nametag hacks (not normal nametags that you get without any mods), aren't these working properly?
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
961
Likes
23
Points
68
#8
then why do you assume that getting target actor would not work?
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
961
Likes
23
Points
68
#11
did you check the snippet I referenced?
and why do you think that it will not work when the player is too far?
 

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
984
Likes
75
Points
43
Location
Lithuania
Website
ugbase.eu
10
#14
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: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
FOR [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    IF AND
        0029:  [email protected] >= 0x00
        001B:  0x80 > [email protected]
    THEN
        005A: [email protected] += [email protected]
            IF AND
            803B:   [email protected] == $PLAYER_ACTOR  // (int)
            056D:   actor [email protected] defined
            THEN
                0B2B: samp [email protected] = get_player_id_by_actor_handle [email protected]
                0B36: samp [email protected] = get_player_nickname [email protected]
                00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]
                00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
                0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected]
                IF
                [email protected] <= 1.0 /// You can set distance here, max is 300.0(Float)
                THEN
                    Printf "ID: %d Nick: %s" 5000 [email protected] [email protected]
                END
           END
       END
   END
END

END
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
961
Likes
23
Points
68
#15
OP
OP
Doublesix

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#16
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: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
FOR [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    IF AND
        0029:  [email protected] >= 0x00
        001B:  0x80 > [email protected]
    THEN
        005A: [email protected] += [email protected]
            IF AND
            803B:   [email protected] == $PLAYER_ACTOR  // (int)
            056D:   actor [email protected] defined
            THEN
                0B2B: samp [email protected] = get_player_id_by_actor_handle [email protected]
                0B36: samp [email protected] = get_player_nickname [email protected]
                00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]
                00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
                0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected]
                IF
                [email protected] <= 1.0 /// You can set distance here, max is 300.0(Float)
                THEN
                    Printf "ID: %d Nick: %s" 5000 [email protected] [email protected]
                END
           END
       END
   END
END

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

Doublesix

Active Member
Joined
Nov 14, 2018
Messages
44
Likes
0
Points
6
5
#18
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
  [email protected] == 1
jf @Noname_121
[email protected] = 0
printf "~r~OFF ~w~- Maskman Checker by Doublesix" 1000
goto @Noname_175

:Noname_121
[email protected] = 1
printf "~g~ON ~w~- Maskman Checker by Doublesix" 1000

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

:Noname_327
IF
0AB1: @Noname_175 0 [email protected]
THEN
// [email protected] is the actor
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0
END
 

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
984
Likes
75
Points
43
Location
Lithuania
Website
ugbase.eu
10
#20
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: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
FOR [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    IF AND
        0029:  [email protected] >= 0x00
        001B:  0x80 > [email protected]
    THEN
        005A: [email protected] += [email protected]
            IF AND
            803B:   [email protected] == $PLAYER_ACTOR  // (int)
            056D:   actor [email protected] defined
            THEN
                0B2B: samp [email protected] = get_player_id_by_actor_handle [email protected]
                0B36: samp [email protected] = get_player_nickname [email protected]
                00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]
                00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
                0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected]
                IF
                [email protected] <= 1.0 /// You can set distance here, max is 300.0(Float)
                THEN
                    Printf "ID: %d Nick: %s" 5000 [email protected] [email protected]
                END
           END
       END
   END
END

END
 

Attachments

Top