CLEO Help Nearest Ped

CLEO related
Status
Not open for further replies.

iAnthony

Moderator
Moderator
Joined
Nov 15, 2013
Messages
590
Reaction score
3
how can i change the /rob to /stats?
i want it to /stats the nearest person beside me

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

//-------------MAIN---------------
thread "Rob"

:ROB_7
wait 0
if and
056D:  actor $PLAYER_ACTOR defined
key_down 50
jf @ROB_7
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
if
056D:  actor 1@ defined
jf @ROB_81
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
say "/rob %d" 2@

:ROB_81
wait 2000
goto @ROB_7

im starting off with something easy like this

this is my code but it doesnt work

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

//-------------MAIN---------------
thread "Stats"

:STATS_7
wait 0
if and
056D:  actor $PLAYER_ACTOR defined
key_down 50
jf @STATS_7
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
if
056D:  actor 1@ defined
jf @ROB_81
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
say "/stats %d" 2@

:STATS_81
wait 2000
goto @STATS_7

what am i doing wrong?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
thread "Stats"

:STATS_7
wait 0
if and
056D:  actor $PLAYER_ACTOR defined
key_down 50
jf @STATS_7
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
if
056D:  actor 1@ defined
jf @ROB_81
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
say "/stats %d" 2@

:STATS_81
wait 2000
goto @STATS_7
Just change "ROB" with "STATS"
Btw, is the original code working properly?
 

iAnthony

Moderator
Moderator
Joined
Nov 15, 2013
Messages
590
Reaction score
3
I havent tested the original code. I saw players saying it works tho
We can /rob in my server lol
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,125
Reaction score
149
I'm not sure but the reason may be about:
Code:
say "/stats %d" 2@


Try this, it works for me:
Code:
{$CLEO .cs}
0000: NOP

thread "Stats"

:STATS_7
wait 0
if and
056D:   actor $PLAYER_ACTOR defined
key_down 50
jf @STATS_7
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
if
056D:   actor 1@ defined
jf @STATS_81
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0AD3: 0@v = format "/stats %d" 2@ 
0AF9: samp say_msg 0@v

:STATS_81
wait 2000
goto @STATS_7
 

iAnthony

Moderator
Moderator
Joined
Nov 15, 2013
Messages
590
Reaction score
3
monday link said:
I'm not sure but the reason may be about:
Code:
say "/stats %d" 2@


Try this, it works for me:
Code:
{$CLEO .cs}
0000: NOP

thread "Stats"

:STATS_7
wait 0
if and
056D:   actor $PLAYER_ACTOR defined
key_down 50
jf @STATS_7
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
if
056D:   actor 1@ defined
jf @STATS_81
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0AD3: 0@v = format "/stats %d" 2@ 
0AF9: samp say_msg 0@v

:STATS_81
wait 2000
goto @STATS_7
which server did this work in?
it doesnt even work in rss either
 
Status
Not open for further replies.
Top