Properly Setup your Cleo Coding Tools to avoid Problems

In this topic, I'll be teaching you how to properly Setup the tools you'll need to Code GTASA Cleo Scripts(especially for SAMP).

Why do you need to do this?
  • To avoid Sanny Builder Related problems/errors of course!
  • To make sure that every cleo script gets compiled properly.
  • To make sure thay every cleo files gets decompiled properly(as long as it isn't encrypted).

1. Install ASI Loader to your GTASA
2. Install Cleo Plugin to your GTASA
1. Install Sanny Builder v3.5.1 .
Updates = More features + bugfixes. Yes it's true, but I find some features of the newer SB version inconvenient (especially the $USE <extension>). You can use its latest version if you still find it interesting. But for SAMPFUNCS Users, keep reading...

SAMPFUNCS is an old plugin that was released during the days of SB v3.2.0(year 2014). Even during that time up until now, the SB team didn't even considered SAMPFUNCS as its official Extension(considering the fact that they made NewOpcodes, CLEO++ it's official extensions).

So expect that when SB make new changes from their continuous updates, sooner or later SF will be left Incompatible with SB(just a guess).

By that, I suggest STOP UPDATING Sanny Builder and stick to its older version like v3.5.1 especially if you are using the SAMPFUNCS Plugin.
According to this Tutorial:
  1. Download this customized extensions.txt .
  2. Locate and Open your Sanny Builder Folder.
  3. Inside extensions.zip, you'll see two folders inside named backup\ and data\. Extract only the extensions.zip\data\ folder to your Sanny Builder Folder.
    • When asked to replace extensions.txt? , hit OK/Replace.
2. At the Bottom right side of the SB Window, make sure that the Sanny Builder Editor Mode is in GTA San Andreas. You'll see the gtasa logo if it's currently in gtasa, if not then click it this region to change the editor mode.

3. Makes sure you have the same settings as seen on these pictures. This avoids encoding problems when compiling/decompiling a script.

For more Information about Sanny Builder, visit this link.
  1. Download SAMPFUNCS and then open this archive
  2. Locate the folder where your Sanny Builder is installed.
  3. Copy all the files Inside the SAMPFUNCS SDK/Sanny Builder Data/ Folder, and then Paste all of them inside Sanny Builder/data/sa/ Folder.
  4. Put SAMPFUNCS.asi at your GTASA directory
Question: I want to make SAMPFUNCS Work Properly on the Latest Sanny Builder Version. How can I do that?
Answer: Read this Topic.

For more Information about SAMPFUNCS, visit this link.
 

Attachments

  • 1644099408699.png
    1644099408699.png
    12.5 KB · Views: 1,136
Last edited:

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Very useful! Also, we can keep this topic to be only for help? For example a lot of newbies (me included) have some silly questions to ask..getting errors or something else.
We can keep only the questions and answers :D
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
Very useful! Also, we can keep this topic to be only for help? For example a lot of newbies (me included) have some silly questions to ask..getting errors or something else.
We can keep only the questions and answers
Ask away, it's better that way so that questions like that will be kept on one place instead of individuals creating verbose help topics.
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
Code:
IF 10@ == true
then
    wait 5000
    IF 0B4C:  samp is_dialog_active -1
    then
        wait 3000
        0B49: samp set_current_dialog_list_item 2
        wait 1000
        0B47: samp close_current_dialog_with_button 1
        wait 5000
        10@ = false   
    end
end

I am always in trouble when it comes to dialogs. When i need it the most, 0B49: opcode it's not working. Why?
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
I am always in trouble when it comes to dialogs. When i need it the most, 0B49: opcode it's not working. Why?
Maybe the list item number is wrong. Detect your target item number using opcode 0B48
PHP:
0B48: samp 0@ = get_current_dialog_list_item
printf "%d" 2000
Then change opcode 0B49's passed value equal to your target list item number.
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
//edit
i think was because of sampfuncs
i downloaded latest and works now
 
Last edited:

blvck0v

Active member
Joined
Feb 23, 2019
Messages
98
Reaction score
51
Location
ugbase.eu
In this topic, I'll be teaching you how to properly Setup the tools you'll need to Code GTASA Cleo Scripts(especially for SAMP).

Why do you need to do this?
  • To avoid Sanny Builder Related problems/errors of course!
  • To make sure that every cleo script gets compiled properly.
  • To make sure thay every cleo files gets decompiled properly(as long as it isn't encrypted).

1. Install ASI Loader to your GTASA
2. Install Cleo Plugin to your GTASA
1. Download Sanny Builder v3.5.1
Updates = More features + bugfixes. Yes it's true, but I find some features of the newer SB version inconvenient (especially the $USE <extension>). You can use it's latest version if you still find it interesting. But for SAMPFUNCS Users, keep reading...

SAMPFUNCS is an old plugin that was released during the days of SB v3.2.0(year 2014). Even during that time up until now, the SB team didn't even considered SAMPFUNCS as its official Extension(considering the fact that they made NewOpcodes, CLEO++ it's official extensions).

So expect that when SB make new changes from their continuous updates, sooner or later SF will be left Incompatible with SB(just a guess).

By that, I suggest STOP UPDATING Sanny Builder and stick to its older version like v3.5.1 especially if you are using the SAMPFUNCS Plugin.
2. At the Bottom right side of the SB Window, make sure that the Sanny Builder Editor Mode is in GTA San Andreas. You'll see the gtasa logo if it's currently in gtasa, if not then click it this region to change the editor mode.

3. Makes sure you have the same settings as seen on these pictures. This avoids encoding problems when compiling/decompiling a script.
  1. Download SAMPFUNCS and then open this archive
  2. Locate the folder where your Sanny Builder is installed.
  3. Copy all the files Inside the SAMPFUNCS SDK/Sanny Builder Data/ Folder, and then Paste all of them inside Sanny Builder/data/sa/ Folder.
  4. Put SAMPFUNCS.asi at your GTASA directory

Question: I want to make SAMPFUNCS Work Properly on the Latest Sanny Builder Version. How can I do that?
Answer: Read this Topic.

I would like to suggest using this file for Sanny Builder v3.8.0 or higher (when they ll exist) to remove the need for {$USE extension},
making scripting on v3.8.0 or higher similar with older versions.
I have tested this with scripts I made that required {$use } and by having this file they compile and work as normal without using {$use }.
For people not familiar with this, install by droping and replacing folder "data" from archive to Sanny Builder v3.8.0 or higher main installation folder.
 

Attachments

  • extensions.zip
    8.1 KB · Views: 14

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
I would like to suggest using this file for Sanny Builder v3.8.0 or higher (when they ll exist) to remove the need for {$USE extension},
making scripting on v3.8.0 or higher similar with older versions.
I have tested this with scripts I made that required {$use } and by having this file they compile and work as normal without using {$use }.
For people not familiar with this, install by droping and replacing folder "data" from archive to Sanny Builder v3.8.0 or higher main installation folder.
Tutorial added to first post.
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
what are the difference between jump and gosub ? For labels. If there are any
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
what are the difference between jump and gosub ? For labels. If there are any

Jump(a.k.a. GoTo statement) - as the name says, tells the script unconditionally jump/transfer to another section/label within the script and continue executing with no return.
PHP:
{$CLEO}
0000: jump demonstration
:section1
0ACD:   show_text_highpriority "My actor is still Alive! Let me try to jump" time 1000
Wait 1000
Jump @section 3
020C: create_explosion_with_radius 1000 at 0@ 1@ 2@ // this explosion will not happen because the script jumped before encountering it.
:section2
0ACD:   show_text_highpriority "this script is still Alive! Let me jump try jumping" time 1000
wait 1000
Jump @section1
05BE: AS_actor $PLAYER_ACTOR die // this will not be executed because the script jumped
00A1: put_actor $PLAYER_ACTOR at 345.5621 306.2212 998.4484 // this also will not be executed...
:section3
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0AD1:   show_formatted_text_highpriority "my position:~n~%f %f %f" time 1000 0@ 1@ 2@
wait 1000
Jump @section2
0A93: end_custom_thread // this will not work because the script jumped before encountering this, what a clever script!




GoSub(a.k.a. Go Subtitute Routine) - is just like jump, but instead of continuously executing the script, the script goes back to where this command was executed when a return statement is encountered.
PHP:
{$CLEO}
0000: gosub demonstration
While true
    Wait 1000
    Gosub @section2 // temporarily execute this section
        // I'm back Beybeh!
    0223: set_actor $PLAYER_ACTOR health_to 100
    0ACD:   show_text_highpriority "now health became 100!" time 1000
    Wait 1000
    Gosub @section1 // temporarily execute this section
        // I'm back again Beybeh!
    0223: set_actor $PLAYER_ACTOR health_to 20
    0ACD:   show_text_highpriority "ah my health became 20!" time 1000
End

:section1
    00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
    0AD1:   show_formatted_text_highpriority "my position:~n~%f %f %f" time 1000 0@ 1@ 2@
    Wait 1000
Return // go back to where the previous gosub got executed.
020C: create_explosion_with_radius 1000 at 0@ 1@ 2@ // this explosion will not happen because the script already returned to where it was, before encountering this command.
:section2
   0ACD:   show_text_highpriority "let me heal after 1 sec" time 1000
return
05BE: AS_actor $PLAYER_ACTOR die // this will not be executed because the script returned back to its original section
00A1: put_actor $PLAYER_ACTOR at 345.5621 306.2212 998.4484 // this also will not be executed...


Continue reading here:
 
Top