CLEO Help how to use nops in cleo

CLEO related
Status
Not open for further replies.

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
so i made a script NOP weapondata with spawning a M4 but idk what did i wrong. take a look on the script pls.

Code:
{$CLEO .cs}

////////////////MAIN/////////////
0000:NOP
thread "main"
0B34: samp register_client_command ".m4" to_label @

:blank
wait 0
jump @blank

:nop
wait 0
0BE2: raknet setup_outcoming_packet_hook 1@
jf @nop
wait 100
0BE5: raknet 1@ = get_hook_param 1 
IF 1@ == 217
THEN
    0BE0: raknet hook_ret false 
END
0BE0: raknet hook_ret true
jf @nop
goto @m4

:m4
wait 0
Model.Load(356)
wait 100
if
Model.Available(356)
jf @m4
wait 100
Actor.GiveWeaponAndAmmo($Player_ACTOR, Minigun, 9999)
wait 100
Model.Destroy(356)
0B43: samp cmd_ret
it says //''Couldn''t get the local variable @.''// let me know how to use @ variables, and how to correctly use NOP in SB. thanks.
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
0BE2: raknet setup_outcoming_packet_hook 1@ put it at top of script and it dont need a variable it needs a label so do it like 0BE2: raknet setup_outcoming_packet_hook @ProcessRPC, I havent checked whole script cause i'm between a dota game. so this is the only mistake I found when I looked at it for first time
and create a new label :processRPC
and there you put your raknet code
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
0x32789 said:
0BE2: raknet setup_outcoming_packet_hook 1@ put it at top of script and it dont need a variable it needs a label so do it like 0BE2: raknet setup_outcoming_packet_hook @ProcessRPC, I havent checked whole script cause i'm between a dota game. so this is the only mistake I found when I looked at it for first time
and create a new label :processRPC
and there you put your raknet code

ty bro.

edit; dont working.
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
Code:
{$CLEO .cs}

////////////////MAIN/////////////
0000:NOP
thread "main"
0B34: samp register_client_command ".m4" to_label @m4
0B34: samp register_client_command "nop" to_label @ProcessRPC
0BE2: raknet setup_outcoming_packet_hook to @ProcessRPC

:blank
wait 0
jump @blank

:ProcessRPC
wait 0
0BE5: raknet 1@ = get_hook_param 1 
IF 1@ == 217
THEN
   0BE0: raknet hook_ret false 
END
0BE0: raknet hook_ret true
jf @ProcessRPC
chatmsg "NOPed succesfully." 
0B43: samp cmd_ret

:m4
wait 0
Model.Load(356)
wait 100
Actor.GiveWeaponAndAmmo($Player_ACTOR, M4, 9999)
wait 100
Model.Destroy(356)
0B43: samp cmd_ret
 

Ninja FTW

Active member
Joined
Aug 11, 2017
Messages
61
Reaction score
0
Location
Saturn
PHP:
{$CLEO .cs}
0000: NOP

0B34: samp register_client_command ".m4" to_label @m4
0B34: samp register_client_command "nop" to_label @ProcessRPC
0BE2: raknet setup_outcoming_packet_hook to @ProcessRPC

:blank
wait 0
jump @blank

:ProcessRPC
wait 0
0BE5: raknet 1@ = get_hook_param 1 
IF 1@ == 217
  THEN
  0BE0: raknet hook_ret false 
  chatmsg "NOPed succesfully." 
     ELSE
        0BE0: raknet hook_ret true
       END
END
0B43: samp cmd_ret

:m4
wait 0
Model.Load(356)
if
  Model.Available(356)
jf @m4
wait 100
Actor.GiveWeaponAndAmmo($Player_ACTOR, M4, 9999)
wait 100
Model.Destroy(356)
0B43: samp cmd_ret
I'm not really Good in High-Level but here is the script! Hope, it'll work and you again mentioned some mistakes like the previous one.
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
Ninja FTW said:
PHP:
{$CLEO .cs}
0000: NOP

0B34: samp register_client_command ".m4" to_label @m4
0B34: samp register_client_command "nop" to_label @ProcessRPC
0BE2: raknet setup_outcoming_packet_hook to @ProcessRPC

:blank
wait 0
jump @blank

:ProcessRPC
wait 0
0BE5: raknet 1@ = get_hook_param 1 
IF 1@ == 217
  THEN
  0BE0: raknet hook_ret false 
  chatmsg "NOPed succesfully." 
     ELSE
        0BE0: raknet hook_ret true
       END
END
0B43: samp cmd_ret

:m4
wait 0
Model.Load(356)
if
  Model.Available(356)
jf @m4
wait 100
Actor.GiveWeaponAndAmmo($Player_ACTOR, M4, 9999)
wait 100
Model.Destroy(356)
0B43: samp cmd_ret
I'm not really Good in High-Level but here is the script! Hope, it'll work and you again mentioned some mistakes like the previous one.

i will try nop version, ty. and i suggest you to dont use ''if'' and ''Model.Available'' in your basic wep scripts. its more clear without them and high zyntax with basic script will freeze the game in loading screen.

edit: dont working.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
[shcode=cpp]
{$CLEO}

THREAD "NOP"

REPEAT
WAIT 0
UNTIL SAMP.AVAILABLE()

CONST
PARAM_PACKETID = 1
END

0BE2: @nop
0B34: ".m4" @M4

WHILE TRUE
WAIT 0
END

:nop
wait 0
0BE5: 1@ = PARAM_PACKETID
IF
1@ == 204
THEN
0BE0: FALSE
END
0BE0: TRUE


:m4
wait 0
0B35: 2@
0247: 356
IF
0248: 356
THEN
01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999
0249: 356
END
CMDRET
[/shcode]
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
0B36 said:
[shcode=cpp]
{$CLEO}

THREAD "NOP"

REPEAT
WAIT 0
UNTIL SAMP.AVAILABLE()

CONST
PARAM_PACKETID = 1
END

0BE2: @nop
0B34: ".m4" @M4

WHILE TRUE
WAIT 0
END

:nop
wait 0
0BE5: 1@ = PARAM_PACKETID
IF
   1@ == 204
THEN
   0BE0: FALSE
END
0BE0: TRUE


:m4
wait 0
0B35: 2@
       0247: 356
       IF
           0248: 356
       THEN
           01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999
           0249: 356
       END    
CMDRET
[/shcode]

it isnt working. also with your script, /.m4 command dont working too. :-/
 

Ninja FTW

Active member
Joined
Aug 11, 2017
Messages
61
Reaction score
0
Location
Saturn
@0B36: Why don't you use full opcode description so, he can understand them easily!

PHP:
// This is High-Level Syntax. The Script from 0B36
{$CLEO .cs}
 
THREAD "NOP" // Since, he add the "THREAD" with name "NOP" then all the labels names will change into "NOP"
// YOU CAN ALSO ADD "0000: NOP" to prevent the script from changing the label names but as i mentioned before that You can select only one in "0000: NOP" or "THREAD "" "
 
REPEAT // Repeat the further things
WAIT 0
UNTIL SAMP.AVAILABLE() // Until SAMP is not connected (means Available) // Combining both "Repeat" and "UNTIL" it'll become like "Repeat the condition/statement (SAMP.AVAILABLE()) Until it's not TRUE

// Cut the CONST
 
0BE2: raknet setup_outcoming_packet_hook @NOP // Will jump to @NOP First
0B34: samp register_client_command ".M4" to_label @M4 
 
WHILE TRUE  // Like you've said that You work on C++ before so.. you know what this means but still... it'll KEEP Looping the condition and body until you won't add "Break" statement. In low-level.. it will be represented as label with "jump" statement
WAIT 0
END // You know what it is. There's no such a thing in low-level
 
:NOP 
wait 0
0BE5: raknet 1@ = get_hook_param 1 // '1@' are the local variables in SB. The maximum you can declare are 32@ or 31@ IMO. '1' in "0BE5" opcode will first check the previous "0BE2" opcode if it's declare and then you can enable it 
IF 
    1@ == 204
THEN
    0BE0: raknet hook_ret 0 //  Returing will be false!
END
0BE0: raknet hook_ret 1 // Now it can return to do this again! 
 
 
:M4
wait 0
        0247: load_model #MINIGUN  // Instead of taking model number.. why don't you just write it's name (which will make the script easy to understand) 
        IF
            0248:   model #MINIGUN available
        THEN
            01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999  // Here the weapon number (not model number) will be use.. Go to Help > Contents > SCM Documentation > Weapon numbers for more info
            0249: release_model #MINIGUN  // Release it!
        END    
0B43: samp cmd_ret // Will return to start if you want to enable the script again!
Try this!
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
Ninja FTW said:
@0B36: Why don't you use full opcode description so, he can understand them easily!

PHP:
// This is High-Level Syntax. The Script from 0B36
{$CLEO .cs}
 
THREAD "NOP" // Since, he add the "THREAD" with name "NOP" then all the labels names will change into "NOP"
// YOU CAN ALSO ADD "0000: NOP" to prevent the script from changing the label names but as i mentioned before that You can select only one in "0000: NOP" or "THREAD "" "
 
REPEAT // Repeat the further things
WAIT 0
UNTIL SAMP.AVAILABLE() // Until SAMP is not connected (means Available) // Combining both "Repeat" and "UNTIL" it'll become like "Repeat the condition/statement (SAMP.AVAILABLE()) Until it's not TRUE

// Cut the CONST
 
0BE2: raknet setup_outcoming_packet_hook @NOP // Will jump to @NOP First
0B34: samp register_client_command ".M4" to_label @M4 
 
WHILE TRUE  // Like you've said that You work on C++ before so.. you know what this means but still... it'll KEEP Looping the condition and body until you won't add "Break" statement. In low-level.. it will be represented as label with "jump" statement
WAIT 0
END // You know what it is. There's no such a thing in low-level
 
:NOP 
wait 0
0BE5: raknet 1@ = get_hook_param 1 // '1@' are the local variables in SB. The maximum you can declare are 32@ or 31@ IMO. '1' in "0BE5" opcode will first check the previous "0BE2" opcode if it's declare and then you can enable it 
IF 
    1@ == 204
THEN
    0BE0: raknet hook_ret 0 //  Returing will be false!
END
0BE0: raknet hook_ret 1 // Now it can return to do this again! 
 
 
:M4
wait 0
        0247: load_model #MINIGUN  // Instead of taking model number.. why don't you just write it's name (which will make the script easy to understand) 
        IF
            0248:   model #MINIGUN available
        THEN
            01B2: give_actor $PLAYER_ACTOR weapon 38 ammo 9999  // Here the weapon number (not model number) will be use.. Go to Help > Contents > SCM Documentation > Weapon numbers for more info
            0249: release_model #MINIGUN  // Release it!
        END    
0B43: samp cmd_ret // Will return to start if you want to enable the script again!
Try this!
the wrong thing with 0B36's script, i dont think you need high level zyntax for a 20-30 line script. since cleo language allows you to use simple conditions rather than ''if else then etc etc'' for basic scripts. i think there is a easy for using it without them. ty anyway.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Because it's self explanatory if he looks up at the opcodes from the SB, I can't be arsed to provide detailed explanations. That is something he will have to do if he wants to learn.
 

jasonbigcock03

Active member
Joined
Jul 8, 2017
Messages
37
Reaction score
0
0B36 said:
Because it's self explanatory if he looks up at the opcodes from the SB, I can't be arsed to provide detailed explanations. That is something he will have to do if he wants to learn.
Ninja's version is works perfectly but guess what? your script dont work, and not just 'NOP' version, you broked '.m4' line too. after that, i stalked your help posts and tryed your scripts. some of them fully dont work, and some of them is broken. i think it will be good for you if you take a look on how to coding well before using high zyntaxs
 
Status
Not open for further replies.
Top