HarryPotterTroll
Member
Hi everybody, I've been trying to do a function which I could call it from my main code. The function is supposed to add a chat message with the nearest player name.
The problem I got is that I can't break the loop and the for loop goes on.
Here the piece of code:
I'd like to have the possibility to call it.
The problem I got is that I can't break the loop and the for loop goes on.
Here the piece of code:
Code:
{$CLEO .cs}
0000: NOP
repeat
wait 0
until 0AFA:
:activation
wait 0
if and
0AB0: 109
not SAMP.ChatInputOpened($PLAYER_ACTOR)
jf @activation
call @playername
jump @activation
:playername
wait 0
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 7@ = get_player_id_by_actor_handle 31@
0B36: samp 15@ = get_player_nickname 7@
0B2B: samp 16@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 17@ = get_player_nickname 16@
00A0: store_actor $PLAYER_ACTOR position_to 8@ 9@ 10@
00A0: store_actor 31@ position_to 11@ 12@ 13@
0509: 14@ = distance_between_XY 8@ 9@ and_XY 11@ 12@
IF
14@ <= 6.0 /// If distance smaller 6 then... , max 300.
THEN IF AND
0AB0: key_pressed 109
not SAMP.ChatInputOpened($PLAYER_ACTOR)
THEN
chatmsg "%s got %s's protection." 0x33CC99 17@ 15@
wait 3000
END
END
END
END
END
Last edited: