CLEO Help Disable/Enable CLEO script on the same command?

CLEO related
Status
Not open for further replies.

Crokit

Active member
Joined
Jun 20, 2014
Messages
37
Reaction score
0
I know, for commands I need SAMPFUNCS, I have it, MGFunc too.

So dus any1 know how to add a disable and enable for a CLEO script on the same command?
Da problem is that we can only put 1 label per command... and there are some scripts that use same cmd for deact. and act. like SR_Team's GM.

So, let GM be an example?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Code:
0B34: samp register_client_command "activation" to_label @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0AF9: say_msg "spam spam spam" 
end
END

:activation
0B12: 0@ = 0@ XOR 1
if 0@ == 1
then 0AF8: "Cheat on" -1
else 0AF8: "Cheat off" -1
end
cmd_ret
 

Crokit

Active member
Joined
Jun 20, 2014
Messages
37
Reaction score
0
springfield link said:
Code:
0B34: samp register_client_command "activation" to_label @activation

WHILE TRUE
wait 0
if 0@ == 1
then
    0AF9: say_msg "spam spam spam" 
end
END

:activation
0B12: 0@ = 0@ XOR 1
if 0@ == 1
then 0AF8: "Cheat on" -1
else 0AF8: "Cheat off" -1
end
cmd_ret
So, what exactly is the first part and what is the second one for?

First one is actual function of hack? And second part under :activation is to notify player dat hack is activated? Or other way around?

Any example of a hax?
I never actually tried doing commands... so...

And XOR is?

Thx alot
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
It's a simple switch command, on/off with the same key/command.
In this case you only use the command for activation only.
The first part is the main script, in a loop.
The second part(label; activation) is the toggle on/off switch that works with a command.

Using /activation once will toggle the script on(0@ becomes 1/true) and then goes back to the first loop, with a simple check to see if script is on(if 0@ == 1)and it will spam the chat with that message, now if you type /activation again, the script will toggle off(0@ becomes 0/false) and return to the first loop again, but now script won't contiune because it doesn't meet the condition(if 0@ == 1).

About XOR, http://en.wikipedia.org/wiki/Exclusive_or
 

Crokit

Active member
Joined
Jun 20, 2014
Messages
37
Reaction score
0
springfield link said:
It's a simple switch command, on/off with the same key/command.
In this case you only use the command for activation only.
The first part is the main script, in a loop.
The second part(label; activation) is the toggle on/off switch that works with a command.

Using /activation once will toggle the script on(0@ becomes 1/true) and then goes back to the first loop, with a simple check to see if script is on(if 0@ == 1)and it will spam the chat with that message, now if you type /activation again, the script will toggle off(0@ becomes 0/false) and return to the first loop again, but now script won't contiune because it doesn't meet the condition(if 0@ == 1).

About XOR, http://en.wikipedia.org/wiki/Exclusive_or

Yes, but, how2create (for exampl) a simple GM with it? With 02AB or 02AC?
Since this is for loop activation.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Crokit link said:
[quote author=springfield link=topic=7817.msg44657#msg44657 date=1403272988]
It's a simple switch command, on/off with the same key/command.
In this case you only use the command for activation only.
The first part is the main script, in a loop.
The second part(label; activation) is the toggle on/off switch that works with a command.

Using /activation once will toggle the script on(0@ becomes 1/true) and then goes back to the first loop, with a simple check to see if script is on(if 0@ == 1)and it will spam the chat with that message, now if you type /activation again, the script will toggle off(0@ becomes 0/false) and return to the first loop again, but now script won't contiune because it doesn't meet the condition(if 0@ == 1).

About XOR, http://en.wikipedia.org/wiki/Exclusive_or

Yes, but, how2create (for exampl) a simple GM with it? With 02AB or 02AC?
Since this is for loop activation.
[/quote]

Code:
if 0@ == 1
then
    02AB: set_actor $player_actor immunities BP 1 FP 1 EP 1 CP 1 MP 1
else
    02AB: set_actor $player_actor immunities BP 0 FP 0 EP 0 CP 0 MP 0
end

Hidend link said:
Do this without sampfuncs springfield?
commands or what?
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
627
Reaction score
40
You need this

0B34: samp register_client_command "activation" to_label @activation

so need sampfuncs...

i want to know how to do activate/desactive option without sampfuncs, for example, in the cleo you posted here... how you will do that without sampfuncs?
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Code:
WHILE TRUE
wait 0
if 0ADC: "ABC" //key for activation, key, test_cheat etc.
then 0B12: 31@ = 31@ XOR 1
    if 31@ <> 0
    then 0AD1: "cheat on" 1000
    else 0AD1: "cheat off" 1000
    end
end

//main script       
if 31@ == 1
then
    0AF9: say_msg "spam spam spam" 
end
END //end main loop

The same way without the command thread.
 
Status
Not open for further replies.
Top