CLEO Help My first CLEO

CLEO related
Status
Not open for further replies.

SpRoXx

Member
Joined
Oct 29, 2016
Messages
23
Reaction score
1
Hi, guys I made my first CLEO , lemme show u what i made
Code:
{$CLEO .cs}

0000: NOP
thread 'PackH&A'

:MAIN
wait 0
0AF8: samp add_message_to_chat "SpRoXx Pack has been loaded:" 0xFFFFFF
0AF8: samp add_message_to_chat "Type 'hl' in singlemode cheat to restore your Health!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'pk' in singlemode cheat to get the Package Armour = 50 + Health = 100!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'ar' in singlemode cheat to restore your Armour!" color 0xFFFFFF


:PACK_1
wait 0
if and
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "pk"
else_jump @PACK_1
0223: set_actor $PLAYER_ACTOR health_to 100
035F: actor $PLAYER_ACTOR armour += 50
0AD1: show_formatted_text_highpriority "Pack has been ADDED Made by SpRoXx!" time 2000
jump @PACK_1

:HEALTH_ONLY
wait 400
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "hl"
else_jump @HEALTH_ONLY
0223: set_actor $PLAYER_ACTOR health_to 100
0AD1: show_formatted_text_highpriority "Health RESTORED!" time 2000
jump @HEALTH_ONLY


:ARMOUR_ONLY
wait 0
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "ar"
else_jump @ARMOUR_ONLY
0223: set_actor $PLAYER_ACTOR armour == 50
0AD1: show_formatted_text_highpriority "Armour has been RESTORED - Might be Dectable" time 2000
jump @ARMOUR_ONLY
I made Health and Armour Pack, I made health separately and armour separately u can use it only when u are on foot.. but the health and armour are not working?, only the Pack works pls what i need to do :D
Thanks
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
SpRoXx said:
Hi, guys I made my first CLEO , lemme show u what i made
I made Health and Armour Pack, I made health separately and armour separately u can use it only when u are on foot.. but the health and armour are not working?, only the Pack works pls what i need to do :D
Thanks

Because loop doesnt reach other parts of code, that's why
But still, that's pretty good for first cleo although you failed with jmp parts, next time you better not write your code as a low-level, keep it on high or mistakes like these will happen
Kinda lazy to explain why (at this moment you should say "RELEASE THE @springfield" so I'll simply fix your code and provide it in both levels 

Low level (added samp base check) :
Code:
{$CLEO .cs}

0000: NOP
thread 'PackH&A'

if 
31@ = SAMP.Base()
else_jump @sampcheck
end_thread 
jump @MAIN 

:sampcheck
   not SAMP.Available
else_jump @MAIN 
wait 100 
jump @sampcheck 



:MAIN
wait 0
0AF8: samp add_message_to_chat "SpRoXx Pack has been loaded:" 0xFFFFFF
0AF8: samp add_message_to_chat "Type 'hl' in singlemode cheat to restore your Health!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'pk' in singlemode cheat to get the Package Armour = 50 + Health = 100!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'ar' in singlemode cheat to restore your Armour!" color 0xFFFFFF


:PACK_1
wait 0
if and
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "pk"
else_jump @HEALTH_ONLY
0223: set_actor $PLAYER_ACTOR health_to 100
035F: actor $PLAYER_ACTOR armour += 50
0AD1: show_formatted_text_highpriority "Pack has been ADDED Made by SpRoXx!" time 2000

:HEALTH_ONLY
//deleted here wait 400 part cuz useless too
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "hl"
else_jump @ARMOUR_ONLY
0223: set_actor $PLAYER_ACTOR health_to 100
0AD1: show_formatted_text_highpriority "Health RESTORED!" time 2000

:ARMOUR_ONLY
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "ar"
else_jump @PACK_1
0223: set_actor $PLAYER_ACTOR armour == 50
0AD1: show_formatted_text_highpriority "Armour has been RESTORED - Might be Dectable" time 2000
jump @PACK_1  //not useless jump cuz at the end of the loop it should jump to the beginning

High level :
Code:
{$CLEO .cs}

0000: NOP
thread 'Pack'

if not 31@ = samp.Base()
then
end_thread
else
    while not samp.Available()
    wait 100
    end
end

wait 0
0AF8: samp add_message_to_chat "SpRoXx Pack has been loaded:" 0xFFFFFF
0AF8: samp add_message_to_chat "Type 'hl' in singlemode cheat to restore your Health!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'pk' in singlemode cheat to get the Package Armour = 50 + Health = 100!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'ar' in singlemode cheat to restore your Armour!" color 0xFFFFFF

while true
wait 0    

//Pack  
if and
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "pk"
then
0223: set_actor $PLAYER_ACTOR health_to 100
035F: actor $PLAYER_ACTOR armour += 50
0AD1: show_formatted_text_highpriority "Pack has been ADDED Made by SpRoXx!" time 2000
end

//Health
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "hl"
then
0223: set_actor $PLAYER_ACTOR health_to 100
0AD1: show_formatted_text_highpriority "Health RESTORED!" time 2000
end

//Armor
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "ar"
then
0223: set_actor $PLAYER_ACTOR armour == 50
0AD1: show_formatted_text_highpriority "Armour has been RESTORED - Might be Dectable" time 2000
end

end //while true
 

SpRoXx

Member
Joined
Oct 29, 2016
Messages
23
Reaction score
1
supahdupahnubah said:
SpRoXx said:
Hi, guys I made my first CLEO , lemme show u what i made
I made Health and Armour Pack, I made health separately and armour separately u can use it only when u are on foot.. but the health and armour are not working?, only the Pack works pls what i need to do :D
Thanks

Because loop doesnt reach other parts of code, that's why
But still, that's pretty good for first cleo although you failed with jmp parts, next time you better not write your code as a low-level, keep it on high or mistakes like these will happen
Kinda lazy to explain why (at this moment you should say "RELEASE THE @springfield" so I'll simply fix your code and provide it in both levels 

Low level (added samp base check) :
Code:
{$CLEO .cs}

0000: NOP
thread 'PackH&A'

if 
31@ = SAMP.Base()
else_jump @sampcheck
end_thread 
jump @MAIN 

:sampcheck
   not SAMP.Available
else_jump @MAIN 
wait 100 
jump @sampcheck 



:MAIN
wait 0
0AF8: samp add_message_to_chat "SpRoXx Pack has been loaded:" 0xFFFFFF
0AF8: samp add_message_to_chat "Type 'hl' in singlemode cheat to restore your Health!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'pk' in singlemode cheat to get the Package Armour = 50 + Health = 100!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'ar' in singlemode cheat to restore your Armour!" color 0xFFFFFF


:PACK_1
wait 0
if and
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "pk"
else_jump @HEALTH_ONLY
0223: set_actor $PLAYER_ACTOR health_to 100
035F: actor $PLAYER_ACTOR armour += 50
0AD1: show_formatted_text_highpriority "Pack has been ADDED Made by SpRoXx!" time 2000

:HEALTH_ONLY
//deleted here wait 400 part cuz useless too
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "hl"
else_jump @ARMOUR_ONLY
0223: set_actor $PLAYER_ACTOR health_to 100
0AD1: show_formatted_text_highpriority "Health RESTORED!" time 2000

:ARMOUR_ONLY
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "ar"
else_jump @PACK_1
0223: set_actor $PLAYER_ACTOR armour == 50
0AD1: show_formatted_text_highpriority "Armour has been RESTORED - Might be Dectable" time 2000
jump @PACK_1  //not useless jump cuz at the end of the loop it should jump to the beginning

High level :
Code:
{$CLEO .cs}

0000: NOP
thread 'Pack'

if not 31@ = samp.Base()
then
end_thread
else
    while not samp.Available()
    wait 100
    end
end

wait 0
0AF8: samp add_message_to_chat "SpRoXx Pack has been loaded:" 0xFFFFFF
0AF8: samp add_message_to_chat "Type 'hl' in singlemode cheat to restore your Health!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'pk' in singlemode cheat to get the Package Armour = 50 + Health = 100!" color 0xFFFFFF
0AF8: samp add_message_to_chat "type 'ar' in singlemode cheat to restore your Armour!" color 0xFFFFFF

while true
wait 0    

//Pack  
if and
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "pk"
then
0223: set_actor $PLAYER_ACTOR health_to 100
035F: actor $PLAYER_ACTOR armour += 50
0AD1: show_formatted_text_highpriority "Pack has been ADDED Made by SpRoXx!" time 2000
end

//Health
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "hl"
then
0223: set_actor $PLAYER_ACTOR health_to 100
0AD1: show_formatted_text_highpriority "Health RESTORED!" time 2000
end

//Armor
if and 
056D:   actor $PLAYER_ACTOR defined
044B:   actor $PLAYER_ACTOR on_foot
0ADC:   test_cheat "ar"
then
0223: set_actor $PLAYER_ACTOR armour == 50
0AD1: show_formatted_text_highpriority "Armour has been RESTORED - Might be Dectable" time 2000
end

end //while true

Thank you very much, Why they call it High level , it's more easier than low level -_- anyway 
I didn't understand what u did there
Code:
if not 31@ = samp.Base()
then
end_thread
else
    while not samp.Available()
    wait 100
    end
end

Can you explain this please? I really want to take this seriously and what is while true, i read Blackhat or springfield idk , but i don't understand it.
 

Hackz0r

Active member
Joined
Oct 31, 2016
Messages
25
Reaction score
0
Code:
if not 31@ = samp.Base()
then                    
end_thread              
else
   while not samp.Available()
   wait 100
   end
end

It just a piece of code run once at the start of the script to check whether or not SAMP is installed (so you won't crash if you want to play singleplayer or something) if the script contains SAMPFUNCS opcodes.

If the base address of SAMP isn't returned, it does "end_thread" which ends the script (cuz you don't have samp.dll)
else, it will wait 100 until samp is loaded and the script can be run
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
SpRoXx said:
Thank you very much, Why they call it High level , it's more easier than low level -_- anyway 
I didn't understand what u did there
Code:
if not 31@ = samp.Base()
then
end_thread
else
    while not samp.Available()
    wait 100
    end
end

Can you explain this please? I really want to take this seriously and what is while true, i read Blackhat or springfield idk , but i don't understand it.

"The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain" - in our case, high level remains the same language, but the other way to write it, I'd say simplier

This piece of code - actually an initialization part, just in case not to let your script execute its code before the samp has been loaded

While true - body of script, called loop, goes over and over again

Just learn basics of programming, start with Pascal.. At least.. And you'll be used in to it
 
Status
Not open for further replies.
Top