setPlateNumber: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Some wiki formatting)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| arma3 |Game name=
|game1= arma3
|version1= 1.82


|1.82 |Game version=
|arg= local


|arg= local |Multiplayer Arguments=
|eff= global


|eff= global |Multiplayer Effects=
|gr1= Object Manipulation


|gr1= Object Manipulation |GROUP1=
|descr= Change the license plates on any vehicle which has plates configured. Max 15 characters are allowed!


|Change the license plates on any vehicle which has plates configured. Max 15 characters are allowed!|DESCRIPTION=
|s1= vehicle [[setPlateNumber]] string


| vehicle '''setPlateNumber''' string |SYNTAX=
|p1= vehicle: [[Object]]


|p1= vehicle: [[Object]] |PARAMETER1=
|p2= string: [[String]]


|p2= string: [[String]] |PARAMETER2=
|r1= [[Nothing]]


| [[Nothing]] |RETURNVALUE=
|x1= <sqf>vehicle player setPlateNumber "K2000";</sqf>


 
|x2= Reset plate to the world's randomised template:
|x1= <code>[[vehicle]] [[player]] '''setPlateNumber''' "Custom Plate 99"</code> |EXAMPLE1=
<sqf>
private _return = "";
private _cfg = (configFile >> "CfgWorlds" >> worldName);


|x2= Reset plate to the world's randomized template:<code>_return = "";
_cfg = ([[configFile]] >> "CfgWorlds" >> [[worldName]]);
{
{
_return = _return + ([[call]] {
_return = _return + (call {
[[if]] (_x == "$") [[exitWith]] {
if (_x == "$") exitWith {
[[selectRandom]] ([[getText]] (_cfg >> "plateLetters") [[splitString]] "")
selectRandom (getText (_cfg >> "plateLetters") splitString "")
};
};
[[if]] (_x == "#") [[exitWith]] {
if (_x == "#") exitWith {
[[selectRandom]] ["0","1","2","3","4","5","6","7","8","9"]
selectRandom ["0","1","2","3","4","5","6","7","8","9"]
};
};
_x
_x
});
});
} [[forEach]] ([[getText]] (_cfg >> "plateFormat") [[splitString]] "");
} forEach (getText (_cfg >> "plateFormat") splitString "");
_car [[setPlateNumber]] _return;</code> |EXAMPLE2=


| [[getPlateNumber]]  |SEEALSO=
_car setPlateNumber _return;
</sqf>


|seealso= [[getPlateNumber]]
}}
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
{{GameCategory|arma3|Scripting Commands}}
|user= Demellion
 
|timestamp= 20180419053400
<!-- CONTINUE Notes -->
|text= '''NOTICE''': If this command is performed where the argument is remote, the plate will change and [[getPlateNumber]] will also return the new value, until vehicle owner sync it back to original in ~10 seconds after.
<dl class="command_description">
}}
<dd class="notedate">Posted on April 19, 2018 - 05:34 (UTC)</dd>
<dt class="note">[[User:demellion|demellion]]</dt>
<dd class="note">
'''NOTICE''': If this command is performed where argument is remote, the plate will change and [[getPlateNumber]] will also return the new value, until vehicle owner sync it back to original in ~10 seconds after.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 12:54, 12 March 2024

Hover & click on the images for description

Description

Description:
Change the license plates on any vehicle which has plates configured. Max 15 characters are allowed!
Groups:
Object Manipulation

Syntax

Syntax:
vehicle setPlateNumber string
Parameters:
vehicle: Object
string: String
Return Value:
Nothing

Examples

Example 1:
vehicle player setPlateNumber "K2000";
Example 2:
Reset plate to the world's randomised template:
private _return = ""; private _cfg = (configFile >> "CfgWorlds" >> worldName); { _return = _return + (call { if (_x == "$") exitWith { selectRandom (getText (_cfg >> "plateLetters") splitString "") }; if (_x == "#") exitWith { selectRandom ["0","1","2","3","4","5","6","7","8","9"] }; _x }); } forEach (getText (_cfg >> "plateFormat") splitString ""); _car setPlateNumber _return;

Additional Information

See also:
getPlateNumber

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
Demellion - c
Posted on Apr 19, 2018 - 05:34 (UTC)
NOTICE: If this command is performed where the argument is remote, the plate will change and getPlateNumber will also return the new value, until vehicle owner sync it back to original in ~10 seconds after.