CLEO Help whats wrong with this script

CLEO related
Status
Not open for further replies.

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
so im new to cleo coding. i made hacks for samp on C# and C++ before like basic aimbots esp etc etc and im bored with C++ and now i want to learn this code language. if someone can say whats wrong with this script, ill glad to hear it. 

Code:
{$CLEO .cs}

/////////////////////MAIN///////////////////
0000:NOP
thread "main"

:command
0B34: samp register_client_command "main" to_label @weapon
chatmsg "Main.cs loaded!"
goto @weapon
 
:weapon
wait 0
Model.Available(362)
wait 100
Model.Load(362) /////Load model before spawn weapon
wait 100
01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 100
and i want to learn some basic things like what jf does or what is @1 @2 etc etc variables. also i know it supports high zyntax but how can i use it on my scripts. thanks in advance.
 

Ninja FTW

Active member
Joined
Aug 11, 2017
Messages
61
Reaction score
0
Location
Saturn
Your Script is completely wrong! Since, you're new in SB... therefore, i'll give you a complete and working script with details:
PHP:
{$CLEO .cs} // To assosicate it with CLEO

0000: NOP  // To prevent from Zero offset Error mostly occur in SCM.. and do not add the " thread "main" " if you want to add 0000: NOP. For adding thread name you've to remove 0000: NOP
// Remember compiling with " thread "main" " will change all the labels with "MAIN" name because you're making a thread with a particular name and 0000: NOP will not change the label names

:Command // label with name "Command"
wait 0 // Always add a wait (delay)
0B34: samp register_client_command "main" to_label @weapon // The opcode which register a commmand with particular name command and label where the opcode will read the body of code (which means he'll jump on a specific label name you've chosed)
// don't add chatmsg here. Add it on "@Weapon" label body.
// Don't add "goto" since the opcode "0B34" will automatically jump on the label

:Space 
wait 0
jump @Space 
// Always when you're registering a comman with "0b34" opcode. Always leave a useless label which consist of nothing or if you want to add in the useless label body then do not represent the label with "0b34" particular label (@weapon) you've chose. 
// Always make a useless label before particular label with the name of any you've chose (@weapon) in "0b34" opcode. This will prevent script from crashing!

:weapon // now add the particular label you selected in '0b34' opcode
wait 0 // It's a good thing
Model.Load(362) // Always first load the Model
if
  Model.Available(362) // Then Avail it!
jf @weapon // "jf" means "then". It's a low level syntax in SB (Sanny builder)
wait 100
01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 100 // then add this after the model is loaded and availabled!
chatmsg "Main.cs loaded!" // Now add this!
0B43: samp cmd_ret // Add thiw when you're using opcode "0B34" Which register the particular command

Always use latest SAMPFUNCS and CLEO 4.1
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
Ninja FTW said:
Your Script is completely wrong! Since, you're new in SB... therefore, i'll give you a complete and working script with details:
PHP:
{$CLEO .cs} // To assosicate it with CLEO

0000: NOP  // To prevent from Zero offset Error mostly occur in SCM.. and do not add the " thread "main" " if you want to add 0000: NOP. For adding thread name you've to remove 0000: NOP
// Remember compiling with " thread "main" " will change all the labels with "MAIN" name because you're making a thread with a particular name and 0000: NOP will not change the label names

:Command // label with name "Command"
wait 0 // Always add a wait (delay)
0B34: samp register_client_command "main" to_label @weapon // The opcode which register a commmand with particular name command and label where the opcode will read the body of code (which means he'll jump on a specific label name you've chosed)
// don't add chatmsg here. Add it on "@Weapon" label body.
// Don't add "goto" since the opcode "0B34" will automatically jump on the label

:Space 
wait 0
jump @Space 
// Always when you're registering a comman with "0b34" opcode. Always leave a useless label which consist of nothing or if you want to add in the useless label body then do not represent the label with "0b34" particular label (@weapon) you've chose. 
// Always make a useless label before particular label with the name of any you've chose (@weapon) in "0b34" opcode. This will prevent script from crashing!

:weapon // now add the particular label you selected in '0b34' opcode
wait 0 // It's a good thing
Model.Load(362) // Always first load the Model
if
  Model.Available(362) // Then Avail it!
jf @weapon // "jf" means "then". It's a low level syntax in SB (Sanny builder)
wait 100
01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 100 // then add this after the model is loaded and availabled!
chatmsg "Main.cs loaded!" // Now add this!
0B43: samp cmd_ret // Add thiw when you're using opcode "0B34" Which register the particular command

Always use latest SAMPFUNCS and CLEO 4.1

nice and a clear tut. thank you bro. also is script wont work if i remove opcodes? since its more clear without them, i want to do it.
 
Status
Not open for further replies.
Top