setVehicleVarName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Example 3)
Line 32: Line 32:
____________________________________________________________________________________________
____________________________________________________________________________________________


|x3= <pre>//Assign a variable to an object and be able to refer to that
//object using the variable, in both single and multi player.
_Object="M1A1" CreateVehicle (GetPos Player);
_VarName="MYTANK";
_Object SetVehicleVarName _VarName;
_Object Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarName];
</pre> |= Example 3
____________________________________________________________________________________________


|  |= See also
|  |= See also

Revision as of 10:35, 2 September 2007

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Sets the name of the variable which contains a reference to this object. It is necessary in MP to change the variable content after a respawn.
Groups:
Uncategorised

Syntax

Syntax:
ObjectsetVehicleVarName "name"
Parameters:
Object
name: String
Return Value:
Nothing

Examples

Example 1:
player setVehicleVarName "aP"
Example 2:
_thing = _this select 0;

_thingname = vehicleVarName _thing; WaitUntil{not alive _thing}; _vcl = _thing createVehicle getpos player; _vcl setVehicleVarName _thingname;

Example 3:
//Assign a variable to an object and be able to refer to that

//object using the variable, in both single and multi player.

_Object="M1A1" CreateVehicle (GetPos Player); _VarName="MYTANK"; _Object SetVehicleVarName _VarName; _Object Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarName];

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section