Games

Write your first CLEO script for GTA San Andreas

This article is intended for those who want to master the programming under the library in GTA San Andreas CLEO and don\'t know where to start ...

So there you go .... First, you should install the CLEO4 library in the game, you can download it from our website- download CLEO4. Think how to install fashion from our site you won\'t have to explain, because it is easier to think of nothing.
Next, download and install Sanny Builder 3, many of you will be asked the question-what is it? This is a program in which they do their skriptery wonders! And today, we will make one of the wonders of the<!--smile:smile-->smile<!--/smile-->

Open Sunny Builder, in the program menu select \"file/new/\", or click the new document icon in the toolbar at the top. Before you open a new document, this will be our first script and save it in the folder of CLEO in the game (where we have installed GTA) under the name MyFirstScript
Пишем свой первый CLEO скрипт


You are now ready and you can start writing code, today we write a script that adds 1000 coins if you click \"+ \", and also resets the wanted level by the main character<!--smile:smile-->smile<!--/smile-->
{$VERSION 3.1.0027}
{$CLEO .cs}

With these lines begins any script. Copy and paste ...

Do you think that we need for this script properly! We need to know at what point we clicked the button \"+ \". We will deal with the KEY_SCAN function
Copy and paste the following lines:

gosub @KEY_SCAN                          //pass to the function KEY_SCAN
:KEY_SCAN                                //start function
wait 0                                   //this is always written
if 0AB0:   key_pressed 187               //if pressed "+" execute our code
jf @KEY_SCAN                             //else jump to the top of the function
wait 100                                 //on delay button
//this will be our code
jump @KEY_SCAN                           //jump to the top of the function


So, we\'re almost already inspect our script, add the remaining money and reset the wanted level!!!

Here\'s how it looks in the code:
Player.Money($PLAYER_CHAR)+=1000         //add to the current amount of 1,000 coins
Player.WantedLevel($PLAYER_CHAR)=0       //the wanted level to zero


Eventually we turned out the following scenario:

{$VERSION 3.1.0027}
{$CLEO .cs}
gosub @KEY_SCAN     
:KEY_SCAN
wait 0
if 0AB0:   key_pressed 187
jf @KEY_SCAN
 wait 100
   Player.Money($PLAYER_CHAR)+=1000
   Player.WantedLevel($PLAYER_CHAR)=0
jump @KEY_SCAN


Click Save, and in the menu select Sanny Builder- \"run/compile/.\" If you did everything correctly and the program has not produced error messages in a folder, you should have a CLEO script named \"MyFirstScript.cs\"
Start the game and click \"+ \" ... Hooray!!!!!! <!--smile:smile05-->smile05<!--/smile--> I have worked and you have?
If so, congratulations on your first CLEO script!

p.s.: Sunny in Help Builder you can find a lot of useful things, including rooms, interesting examples of simple scripts and even examples of entire missions ...
Happy scripting!



To copy the material should include a link to Gamemodding.net!
3
112
Like:  112
smalloff
smalloff

Published on 10 May 2013

To favorites
Share
Share:

Comments (3)

Information
You must be registered to leave a comment on this publication.

Site rules и privacy policy

© 2012-2024 GameModding.com All rights reserved.