Jump to content

trying to make an addon pbo


Leigham

Recommended Posts

I guess where You use the variable.

And don't forget to remove the item from the players inventory, or they will spawn a few hundrets of these bikes.

And don't make it too complex, stick with a simple, but working script and improve it later with advanced functionality.

Greez KiloSwiss

Link to comment
Share on other sites

These are scripting basics.

_veh is a local variable, that only exists in the scope it gets created.
veh is a global variable, that exists local on the machine where it get created.

redefining a variable, will override its previous value or reference.

Simple:
_number = 3;
// Variable "_number" is a number, with the value 3.

_number = _number + 3;
// Variable "_number" is a number, with the value 6.

 

_number = _number + 2.1234;
// Variable "_number" is a float, with the value 8.1234

 

_number = str _number;

or

_number = format["%1", _number];

// _number is now a string "8.1234"

 

 

_number = "twelve";
// _number is now a string "twelve"

 

etc.


Advanced (using vehicle creation):

_veh = "someClassName" createVehicle [x,y,z];
// _veh is referencing to the currently created vehicle.
// (typeOf _veh) returns "someClassName"
_veh setPos [x,y,z];
_veh setDamage .7;
_veh setdir (random 360);
_veh setFuel .3;

_veh = "someOtherClassName" createVehicle [x,y,z];
// _veh is referencing to the new vehicle.
// (typeOf _veh) returns "someOtherClassName"

 

For more information read the official WIKI article:

https://community.bistudio.com/wiki/Variables

 

And KillzoneKids great articles about variables:

http://killzonekid.com/arma-scripting-tutorials-variables-part-1/

http://killzonekid.com/arma-scripting-tutorials-variables-part-2/

http://killzonekid.com/arma-scripting-tutorials-variables-part-3/

 

Greez KiloSwiss

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...