CLEO Help CLEO not working

CLEO related
Status
Not open for further replies.

attic

Active member
Joined
Jan 13, 2017
Messages
40
Reaction score
0
{$CLEO .cs}
0000:

:vest
wait 0
if and
056D: actor $PLAYER_ACTOR defined 
0AB0: key_pressed 101
jf @vest
00A0: store_actor $PLAYER_ACTOR position_to 3@ 4@ 5@
10@ = 100.0
12@ = false

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
           0025:   10@ > 9@ 
           then
           0087: 10@ = 9@
           0085: 11@ = 31@
           12@ = true
           end
       end
   end
   
if 12@ == true
jf @vest

2@ = SAMP.GetSAMPPlayerIDByActorHandle(11@)
0AF9: samp say_msg "/guard %d 200" 2@
wait 1000
jump @vest
(taken from ugbase script)



Also this

{$CLEO .cs}
0000:

:Main
wait 0
if and
056D: actor $PLAYER_ACTOR defined
0AB0: key_pressed 112
jf @Main
02F2: actor $PLAYER_ACTOR model == 0@
if 
0@ = 160
jf @Main
0AF9: samp say_msg "hello"
wait 1000
jump @Main


probably some dumb mistakes since im just starting to experiment
 

MrChristmas

Expert
Joined
Jul 29, 2014
Messages
563
Reaction score
26
Here is a very easy structure for second problem
[shcode=cpp]
{$CLEO}
0000: YE BOIII

:BODY
wait 0
if and
SAMP.Available //Checks if SA:MP is responding
0B61: samp is_local_player_spawned //Checks if local player is spawned
Player.Defined($PLAYER_ACTOR) //Checks if Player_Actor is defined
0AB0: key_pressed 0x112 //Checks if F1 is pressed
jf @NOT_SPAWNED //If not, it jumps to the main body
wait 50
02F2: actor $PLAYER_ACTOR model == 0@ //Creates a 0@ string which we will use later
//02F2 checks if $PLAYER_ACTOR is a selected model
//For example: model name for skin id 160 is
//CWMOHB2
wait 500
if
0@ = #CWMOHB2 //if $PLAYER_ACTOR is using CWMOHB2 player model (skin id 160)
jf @NOT_CWMOHB2 //If not = Jumps into another label
print "Hello Hillbilly!" 1500 // If yes = Prints this message
goto @BODY

:NOT_SPAWNED //This is self-explanatory
wait 0
print "You are not spawned or SA:MP is not available" 1500
goto @BODY

:NOT_CWMOHB2 //This is self-explanatory
wait 0
print "You are not Hillbilly!" 1500
goto @BODY
[/shcode]

For problem 1, it's a /taze script which was already made here on ugbase in much simpler form, try to find it :)
 

attic

Active member
Joined
Jan 13, 2017
Messages
40
Reaction score
0
{$CLEO .cs}
0000:

:Main
wait 0
if and
056D: actor $PLAYER_ACTOR defined
0AB0: key_pressed 112
jf @Main
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
02F2: actor 1@ model == 2@
if and
056D:   actor 1@ defined
2@ = #CWMOHB2
jf @Main
3@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
0AF9: samp say_msg "/guard %d  200" 3@
wait 1000
jump @Main
help
 

attic

Active member
Joined
Jan 13, 2017
Messages
40
Reaction score
0
supahdupahnubah said:
attic said:

Opcode 0AB5 seems to be not working in cleo 4.3, however if you use 4.1 I can give ya the answer
ok fixed the slowmo i didnt put key_pressed but still not working also installed 4.1
{$CLEO .cs}
0000:

:Main
wait 0
if and
056D: actor $PLAYER_ACTOR defined
0AB0: key_pressed 112
jf @Main
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
02F2: actor 1@ model == 2@
if and
056D:   actor 1@ defined
2@ = #CWMOHB2
jf @Main
3@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)


-----------------------------------------------------------
Pretty sure it works till here,but when im near a skin thats this one up^^^ it still says that player isnt near you
0AF9: samp say_msg "/guard %d  200" 3@
wait 1000
jump @Main
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Mr.Christmas kinda provided false info about the 02F2 opcode, because page on the SF wiki says it's only a condition opcode, so there's no outputs, however shit happens, but he did his best anyway, you should also thanks him
First at all you should check if 0AB5 opcode got something on its side, so you simply look if output parameter were more than 0 or -1, no matter rly
Second you check if this dude is in streamed zone (056D: actor 1@ defined), and only then you use 02F2 opcode so it wont fail\throw an exception

Code:
{$CLEO}
0000:
while not samp.Available()
    wait 100
end
2@ = #WMYDRUG

while true
wait 0
if and
0AB0: key_pressed 114
056D: actor $PLAYER_ACTOR defined
0B61: samp is_local_player_spawned
then
    0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to $NOT_USED closest_ped_to 1@
    if and 
    not 1@ == -1
    056D: actor 1@ defined
    02F2: actor 1@ model == 2@
    then
        3@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
        say "/guard %i 200" 3@
    end
end
end
 

attic

Active member
Joined
Jan 13, 2017
Messages
40
Reaction score
0
supahdupahnubah said:
Mr.Christmas kinda provided false info about the 02F2 opcode, because page on the SF wiki says it's only a condition opcode, so there's no outputs, however shit happens, but he did his best anyway, you should also thanks him
First at all you should check if 0AB5 opcode got something on its side, so you simply look if output parameter were more than 0 or -1, no matter rly
Second you check if this dude is in streamed zone (056D: actor 1@ defined), and only then you use 02F2 opcode so it wont fail\throw an exception

Code:
{$CLEO}
0000:
while not samp.Available()
    wait 100
end
2@ = #WMYDRUG

while true
wait 0
if and
0AB0: key_pressed 114
056D: actor $PLAYER_ACTOR defined
0B61: samp is_local_player_spawned
then
    0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to $NOT_USED closest_ped_to 1@
    if and 
    not 1@ == -1
    056D: actor 1@ defined
    02F2: actor 1@ model == 2@
    then
        3@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
        say "/guard %i 200" 3@
    end
end
end

Compiled file has no header, so the model name #CWMOHB2 can not be used. Use number ID instead.


btw thanks a lot for helping me christmas and supah :)
 
Status
Not open for further replies.
Top