Variables for Beginners
#1

new;

Код:
new MyCar;
- This is creating a new variable which can be used in many ways, for example.

Код:
MyCar = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
- Or for you to have more vehicles you can use this.

Код:
new MyCar[5];
Код:
MyCar[0] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[1] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[2] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[3] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[4] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
Interesting Functions

- These are interesting Variables i myself like to use.

Код:
/ = Divide
* = Times
+ = Plus (Obvious)
- = Minus (Obvious)
> = Above Number
< = Below Number
>= = Above or equal to
<= = Below or equal to
|| = or
&& = and
true = if the problem is true
false = if the problem is false
- I will try an example

Код:
new MyNumber = 20;
new Result; // Is 18

Result = MyNumber *10 / 5 + 3 - 5;

if(Result >= 18 || < 19 && true) { return print("Hello!"); return 1; }
- If the result is above or equal to 18 and is below the number 19 and it is true

Got bored and will add more information later when i come home.

EDIT: I'll add array's later :P
Reply
#2

I think everyone knows how.. Though what you did for the vehicles was made by someone else a few days ago..
pawn Код:
MyCar[1] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[2] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[3] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
MyCar[4] = CreateVehicle(ID, Float:X, Float:Y, Float:Z, 0, 0, -1);
You forgot the mycar[0].
Reply
#3

Eh.. I don't really care about 0, not much of a difference, thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)