$INCLUDE command

Sometimes, is usefull to hide some part of the code, to avoid confusion, and also to make it cleaner... or to hide some important code that we will use through the code.
the Include command looks like;
{$INCLUDE [NAME OF FILE]}
or it can also looks like;
{$I [NAME OF FILE]}
the $I is the same as $INCLUDE

the file we are going to Include must go, in the same place, where we keep our script.cs


as example;
as we can see, I'm indicating at Sanny Builder that when I compile the file, it must INCLUDE the content inside the text file named "Declared_Variables.txt"

and the text file must be like;




now, lets do something more interesting...

Aplication of $INCLUDE command
for example;
let's catch a peds & cars in SA. and do something with them...
we are interested in the part of Include command, let's see, the code looks like;
Complete CODE

take a look at the red squares,
they are basically the External_Files that we are going to include inside the script,
now, take a look at the yellow squares |->  ped
the {$I forallpeds}  will return ANY ped_entity around SA world, and it will stored it, into the variable named ped
how it's possible this {$I forallpeds}  returns any ped_entity?  it's possible because the file we include forallpeds contain a code that finds ANY ped_entity around SA.

it's the same for cars;
the {$I forallcars}  will return ANY car_entity around SA world, and it will stored it, into the variable named veh

take a look at the complete code above.

all these;
forallcars
forallpeds
showed in this example, are made by DK22Pac

you can find more information about this in their page;
Link Include Post by DK22Pac

and you can also find all the these include commands inside my ARCHIVE
;)


تعليقات