If you really want to learn it, take your time and read each line of this long reply of mine.
-
Let's make a simple .cs mod together ! What to do ? uhm... Let's make our character bleed when we press F12 button.
EPISODE-I :lol: :lol::lol:
Open Sanny Builder, hit Ctrl + N. Start with this :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
Without that, i think the cleo won't work. Then, add name to your cleo file like below :
Now that we wrote this as total :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'TESTCLEO'
Now we start scripting. To start, put the name you choose for thread as :<yourname>_01, like here:
I added "wait 0", because the cleo crashes if i don't use the "wait" command at the beginning. Now, we will put whatever we want. What do we want ? We want our character to bleed if we press F12 button. Here we go, we will put "if" command to give our .cs file the condition to work. :arrow: :arrow::arrow:
Now we add our condition, what was our condition ? It was "if we press F12 button", then our code is "key_pressed" :arrow: :arrow::arrow:
Now, our script is like this :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'TESTCLEO'
:TESTCLEO_01
wait 0
if
0AB0: key_pressed 123
That "123" is the key for F12. To learn the keys, use
capslockbomber's tutorial
Now, okay we added our condition for the cleo to work, but what if we didn't press F12 ? We must tell the cleo script to do something if we didn't press F12 button. Otherwise cleo would barely work ! So here we go :arrow: :arrow::arrow:
this allows the cleo script to go back and check again if the player pressed F12, and doesn't do anything until player presses F12 key.
Now,this is our code :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'TESTCLEO'
:TESTCLEO_01
wait 0
if
0AB0: key_pressed 123
else_jump @TESTCLEO_01
From beginning till the end, this cleo flow means, "You should press F12, If you don't press F12, i will check again if you press or not, but if you press the F12 key, i will do what you want".
Now that we add what we want ! We hit Altgr + 2 button to open opcode search window, and we type "bleed", we find "0332: set_actor 66@ bleeding 1". We will use that ! Let's do it :arrow: :arrow::arrow:
Code:
0332: set_actor $PLAYER_ACTOR bleeding 1
This will do the trick ;D Now, With this cleo till the end, if we press F12 key, our character will bleed until he dies ;D When he dies, the cleo will stop. But will never work again. How to tell the cleo to work again ? Here :arrow: :arrow::arrow:
Now, the script will always check if you press F12 or not. So, it will ask you again after you die too ;D And when you press F12 after you die, it will work ;D
Finally our entire script (working) :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'TESTCLEO'
:TESTCLEO_01
wait 0
if
0AB0: key_pressed 123
else_jump @TESTCLEO_01
0332: set_actor $PLAYER_ACTOR bleeding 1
jump @TESTCLEO_01
EPISODE-II
Okay i made it, but i want to make it togglable dude, how to do that ?
Let's make it togglable ! So it bleeds when we press F12, but stops bleeding when we press F11 !
Now, If we look at the entire script, we see that we have only 1 condition, we will put another condition ! (to make the cleo file check if we press F11 button too.). How to do ? we had "else_jump @TESTCLEO_01", we will change it into "else_jump @TESTCLEO_02" :arrow: :arrow::arrow:
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'TESTCLEO'
:TESTCLEO_01
wait 0
if
0AB0: key_pressed 123
else_jump @TESTCLEO_02
0332: set_actor $PLAYER_ACTOR bleeding 1
jump @TESTCLEO_01
So, since we said "check TESTCLEO_02", we must make ":TESTCLEO_02" otherwise the cleo won't know what "TESTCLEO_02" means.:arrow: :arrow::arrow:
Now we add our condition again. Almost same, but with another key (F11)
Code:
if
0AB0 : key_pressed 122
else_jump @TESTCLEO_01
0332: set_actor $PLAYER_ACTOR bleeding 0
jump @TESTCLEO_01
I added "else_jump @TESTCLEO_01" because, from the beginning, if the player didn't press F12, it will check if he pressed F11, if the player didn't press F11 either, the cleo will again check if he pressed F12, and it will continue until you close the game.
So here's our entire script :
Code:
{$VERSION 3.1.0027}
{$CLEO .cs}
thread 'TESTCLEO'
:TESTCLEO_01
wait 0
if
0AB0: key_pressed 123
else_jump @TESTCLEO_02
0332: set_actor $PLAYER_ACTOR bleeding 1
jump @TESTCLEO_01
:TESTCLEO_02
wait 0
if
0AB0: key_pressed 122
else_jump @TESTCLEO_01
0332: set_actor $PLAYER_ACTOR bleeding 0
jump @TESTCLEO_01
Woohooo, looks finished & delicious ! Let's save it as .cs file ! Press F6, it will show you a window and it will ask you where to save. From the window go to "GTA San AndreasCLEO" and then in the name, put whatever you want, i put "bleeding". But don't add any extensions ! In name area, only name should be there. In extension area below, .txt will stay. Now, press OK
CONGRATZ ;D You made your own cleo ;D Press F8 to quickly test your bleeding mod in single player ! :arrow: :arrow::arrow:
Toggled it on/off/on/off and it looked like this :lol: :lol::lol:
It will work ;D
With this way you can make whatever you want, and togglable too of course ! ;D
HAVE FUN