Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:1.00

Description

Description:

Sets the name of the variable, which contains a reference to this object. In multiplayer, it is necessary to change the variable content after a respawn. When you only use myVar = vehicle, you define a standard variable, when you use this command as well, myVar becomes the vehicle name - if you have other variables containing the vehicle, they return myVar.

Note: The command does not set myVar to contain the vehicle, this has to be done separately.

Syntax

Syntax:object setVehicleVarName name
Parameters:
  • object: Object - Affected object.
  • name: String - Variable name.
Return Value:Nothing

Examples

Examples:
player setVehicleVarName "aP"

// Changes the NAME property of an object // New NAME can be used with scripting commands // The new NAME is changed on the server and any client computers

_Object="M1A1" CreateVehicle (GetPos Player); _newName="MYTANK";

publicExec ["true", format["%1 SetVehicleVarName '%2'", _Object, _newName]];

_Object Call Compile Format ["%1=_this ; PublicVariable ""%1""",_newName];

Additional Information

See also: vehicleVarName, isValidVarName, setUnitName, VariableNameChanged
Multiplayer:
Problems:

Notes