Using different keys to do specific function

Hello,today i will explain how to use different keys than we used to.

all this time we used this opcode:

Code:
0AB0:   key_pressed 1 //shoot button

list of keys can be found below this topic

ok but now this code is not very useful in many cases ,, like " 0AB0:  key_pressed 49 " this will active the function when you press 1 on the keyboard , but the problem here is we will active the function by mistake when we type 1 in chat , like chatting with friends and typing "attack the 1 on the right" and then you pressed 1 and you active the cheat..

so to fix this , we need to change the codes because we need to active the cheat only when we type in the game not in chat section too..

and the great thing that we can do it with one opcode :) no complex
we use this code :

Code:
0ADC:   test_cheat "run"

so when we type RUN it will active the cheat ,,
PS: the cheat wont activated when you type in chat like "run man run !!"
this is very useful


so in our case we replace this:
Code:
0AB0:   key_pressed 49 // 1 key

with this:
Code:
0ADC:   test_cheat "1" //1 key

to active the cheat only in game just like normal cheats we used to make in all gta series , typing a punch of letters (cheating codes) and active health hack xD

the "test_cheat" opcode is pretty great , because we can make words to active the cheat
like

Code:
0ADC:   test_cheat "black"
so we press B then L then A then C then K

and the cheat will active ,, but here we got a problem , if we say like :

Code:
0ADC:   test_cheat "blackhat"
so we press B then L then A then C then K and then T
here we got problem with the letter T , it will active the chat function , so our keyword will not complete and our cheat wont start ,, we can fix this by not using T letter or by using the TAB key when we press it it will display the list of players then we can type the keyword that contain letter T , because while you are on players list the T letter wont active the chat :)


or you can put " not SAMP.ChatInputOpened()" with "if and" statement , and with this code , it will run the function only when out of chat like pressing 1 only if out of chat it will active the cheat  , but still when the keyword got T this won't help you very much xD , because T will open the chat interface.

we can even use the key press using two keys like this :

Code:
0AB0:   key_pressed 1 //shoot button
0AB0:   key_pressed 2 //aim button

so now when we press aim button (LMB/left mouse botton) and shoot botton (RMB/right mouse botton) it will active the cheat ,, and we can add many like making 4 keys that if pressed in the same time , it will active the cheat

like this

Code:
0AB0:   key_pressed 49 //1 button
0AB0:   key_pressed 50 //2 button
0AB0:   key_pressed 87//w button
0AB0:   key_pressed 81//q button

so when we press (12WQ) the same time the cheat will activated  ,, and we do that by using "if and" statement since we have more than one condition.
like this:

Code:
{$CLEO}


0000:


:1
wait 0
if and
056D:   actor $PLAYER_ACTOR defined
0AB0:   key_pressed 49 //1 button
0AB0:   key_pressed 50 //2 button
0AB0:   key_pressed 87//w button
0AB0:   key_pressed 81//q button
jf @1
0AD0: show_formatted_text_lowpriority "you are pro you clicked 12wq in the same time :)" time 2000 
jump @1   

this script will give you a massage just when you press " 1 2 w q " the same time, i think you know what massage it will display :)

PS: you can't use Two "test_cheat" with words because you can't type two different words in the same time
but we can use it with numbers  or 3 letters , because we can click 3 letters in the same time xD
like this:


Code:
0ADC:   test_cheat "1" //1 key
0ADC:   test_cheat "2" //2 key

here the "test_cheat" opcode and "key_pressed" opcode is the same , they do the same thing , since i never tested "test_cheat" using two opcodes , i don't know if you have to click the keys the same time or one by one , you can try it by yourself though :)
btw you can even use two keys in one opcode "0ADC:  test_cheat "12" //1 and 2 key"


and remember "test_cheat" is not like "key_pressed" , because like in  "key_pressed" when we say "0AB0:  key_pressed 1" this mean the shoot button , but in "test_cheat" 1 is the key 1 on the keyboard , so "test_cheat" can't be used for mouse :p

this is the list of the keys:
Code:
Key         Number

Mouse 1         1
Mouse 2         2
Mouse 3         4
Mouse 4         5
Mouse 5         6


Space         32
Tab         9
Enter         13
Shit         16
Alt         18


F1         112
F2         113
F3         114
F4         115
F5         116
F6         117
F7         118
F8         119
F9         120
F10         121
F11         122
F12         123


Entf         46
Einfg         45
Pos1         36
Ende         35
Bild Down      34
Bild Up         33


Numpad 1      97
Numpad 2      98
Numpad 3      99
Numpad 4      100
Numpad 5      101
Numpad 6      102
Numpad 7      103
Numpad 8      104
Numpad 9      105
Numpad +      107
Numpad -      109
Numpad /      111
Numpad *      106
Arrowleft      37
Arrowright      39
Arrowtop      38
Arrowbottom      40


1         49
2         50
3         51
4         52
5         53
6         54
7         55
8         56
9         57
0         48


´         221
-         189
.         190
,         188
<         226
^         220
ESC         27


A         65
B         66
C         67
D         68
E         69
F         70
G         71
H         72
I         73
J         74
K         75
L         76
M         77
N         78
O         79
P         80
Q         81
R         82
S         83
T         84
U         85
V         86
W         87
X         88
Y         89
Z         90

you can find everything  in this page >>http://ugbase.eu/tutorials/how-to-change-the-activation-keys-on-a-cleo-script/

please ask me the point you didn't understand so i can explain it more detailed to you , if you are not registered , please register so you can join our great community and you can get many help with our friendly support team.


thanks for following my tutorials.

 

NoJustNo

Active member
Joined
Jul 26, 2014
Messages
178
Reaction score
0
Re: 5)using different keys to do specific function-TUT.

FUCK YEA ANOTHER TUTORIAL !!!!! ur awesome Blackhat.  :urtheman: :urtheman: :urtheman: :urtheman:


btw .. can you explain about croods and stuff and about snippets and how to use them and make it a video tutorial if possible.
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: 5)using different keys to do specific function-TUT.

NoJustNo link said:
FUCK YEA ANOTHER TUTORIAL !!!!! ur awesome Blackhat.  :urtheman: :urtheman: :urtheman: :urtheman:


btw .. can you explain about croods and stuff and about snippets and how to use them and make it a video tutorial if possible.

thanks xD
i will come to croods very soon , but no time now, for snippets it is pretty easy , opcode can help you with it , for videos i'm not going to make more videos i think am too  lazzy xD

thanks for following my tutorials
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Re: 5)using different keys to do specific function-TUT.

Or put another check:
not SAMP.ChatInputOpened
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: 5)using different keys to do specific function-TUT.

TH3RM4L link said:
Or put another check:
not SAMP.ChatInputOpened

OR xD -- added  ,, but still when the keyword got T this won't help you very much xD , because T will open the chat interface.
 
Top