CLEO Read commands and do something about them

was this tutorial useful to you?

  • Yes.

    Votes: 5 45.5%
  • No.

    Votes: 3 27.3%
  • Kinda.

    Votes: 3 27.3%

  • Total voters
    11

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
1,090
Likes
135
Points
168
#22
Re: +)read commands and do something about -TUT--open source codes

Thanks for the link, explains the on/off thing. How about any other actions when the command is typed for the second time?

For example:
/abc to store coords
/abc to go there
 

DzkAy

Well-Known Member
Joined
Feb 20, 2014
Messages
472
Likes
0
Points
121
#23
Re: +)read commands and do something about -TUT--open source codes

monday link said:
Thanks for the link, explains the on/off thing. How about any other actions when the command is typed for the second time?

For example:
/abc to store coords
/abc to go there
I haven't try it yet so i don't know
SO. Try it for urself huehuehue :p
 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
1,090
Likes
135
Points
168
#24
Re: +)read commands and do something about -TUT--open source codes

I found out, works well:)
Code:
:Label_3
wait 0
0B12: [email protected] = [email protected] XOR 1
if
[email protected] == 1
then
// here I put what is going to happen when the command is typed for the first time
else jump @Label_2
// Label_2 states what is going to happen when the command is typed for the second time
end
SAMP.CmdRet
jump @Label_1
 
OP
OP
blackHat

blackHat

Well-Known Member
Joined
Jul 28, 2013
Messages
931
Likes
1
Points
121
#25
Re: +)read commands and do something about -TUT--open source codes

monday link said:
I found out, works well:)
Code:
:Label_3
wait 0
0B12: [email protected] = [email protected] XOR 1
if
[email protected] == 1
then
// here I put what is going to happen when the command is typed for the first time
else jump @Label_2
// Label_2 states what is going to happen when the command is typed for the second time
end
SAMP.CmdRet
jump @Label_1
the codes After "else" is the end codes
So let say you spawned object with /abc
Now when u type /abc again destroy the object and end the script too , means just before u end the cheat u can make the deactivation codes such as getting stuff to normal again
 

Rockie

New Member
Joined
Aug 18, 2017
Messages
4
Likes
0
Points
1
1
#27

bladero

Well-Known Member
Joined
Jan 3, 2017
Messages
73
Likes
0
Points
36
#28
Code:
:Start // think you know this
wait 0 //and this
SAMP.IsCommandTyped([email protected])  // you put this so the script can see if you typed a command that you assign above with 0B34:
if 
0AD4: [email protected] = scan_string [email protected] format "%d" [email protected] // Script now looks for what you typed along with command in this case its looking for a number. Here you assigned variable [email protected] as integer
else_jump @USAGE
if 
SAMP.IsPlayerConnected([email protected]) // looks like the script want you to put players id so then it checks if player is connected
else_jump @INVLID_ID 
[email protected] = SAMP.GetActorHandleByPlayerID([email protected]) // here you get the handle of player by using the id witch you put in command as i said above
if 
056D: actor [email protected] defined //the target actor = [email protected]
else_jump @NOT_STREAMED

{
dont be confused with %d %f %s
%d is integer its a whole number like 5 or 1 u get the point
%f is float its a decimal number like 5.1 or 1.75
%s is string its a text

These are all variable types and then you assign them as said above
}
 

bladero

Well-Known Member
Joined
Jan 3, 2017
Messages
73
Likes
0
Points
36
#30
They are variables its used in coding to store some values instead of writing them in and using them later.
 

bladero

Well-Known Member
Joined
Jan 3, 2017
Messages
73
Likes
0
Points
36
#32
I think its some result of the string scanning its not used and i just make public variable with $ and call it like empty or not used something like that.
 
Top