Sign in to follow this  
MGTDB

Simple custom license plates

9 posts in this topic

All purchased and world spawn vehicles with a license plate, such as SUV's, hatchbacks, pickup trucks etc will have custom license plates
in exile_server\code, open ExileServer_object_vehicle_carefulCreateVehicle.sqf

then, after 

clearWeaponCargoGlobal _vehicleObject;

Add
_licPlate = selectRandom [ "SH1T C4R", "P155 0FF", "C4R L055", "4ND R3W", "3X 1LE" ]; _vehicleObject setPlateNumber _licPlate;

You can change any entry in the array, but keep it less than 14 characters each or it may end up wider than the license plate.
Pack you server pbo and it's good to go

8nT6Mwf.jpg

Edited by MGTDB
  • Like 11

Share this post


Link to post
Share on other sites
Advertisement

Hmmm, dont work in mine
with those line:
 

Spoiler

/**
 * ExileServer_object_vehicle_carefulCreateVehicle
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicleClassName", "_position", "_direction", "_usePositionATL", "_temporaryPositionInOuterSpace", "_vehicleObject"];
_vehicleClassName = _this select 0;
_position = _this select 1;
_direction = _this select 2;
_usePositionATL = _this select 3;
_temporaryPositionInOuterSpace = 
[
	(_position select 0) - 250 + (random 500),
	(_position select 1) - 250 + (random 500),
	1000 + (random 1000)
];
_vehicleObject = createVehicle [_vehicleClassName, _temporaryPositionInOuterSpace, [], 0, "CAN_COLLIDE"];
_vehicleObject allowDamage false;
_vehicleObject removeAllEventHandlers "HandleDamage";
_vehicleObject addEventHandler["HandleDamage", {false}];
_vehicleObject setVelocity [0, 0, 0];
if ((typeName _direction) isEqualTo "ARRAY") then 
{
	_vehicleObject setVectorDirAndUp _direction;
}
else 
{
	_vehicleObject setDir _direction;
};
if (_usePositionATL) then
{
	_vehicleObject setPosATL _position;
}
else 
{
	_vehicleObject setPosASL _position;
};
_vehicleObject setVelocity [0, 0, 0];
_vehicleObject allowDamage true;
_vehicleObject removeAllEventHandlers "HandleDamage";
_vehicleObject setDamage 0;
clearBackpackCargoGlobal _vehicleObject;
clearItemCargoGlobal _vehicleObject;
clearMagazineCargoGlobal _vehicleObject;
clearWeaponCargoGlobal _vehicleObject;
//_licPlate = selectRandom [ "RU111", "BUZOVA_CAR", "ENTSRV.RU", "777", "666", "PVE-FOR_GIRLS" ]; _vehicleObject setPlateNumber _licPlate; не работает
if (_vehicleClassName isKindOf "I_UGV_01_F") then 
{
	createVehicleCrew _vehicleObject;
};
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "nightVision") isEqualTo 0) then 
{
	_vehicleObject disableNVGEquipment true;
};
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") isEqualTo 0) then 
{
	_vehicleObject disableTIEquipment true;
};
_vehicleObject

 

 

Share this post


Link to post
Share on other sites
2 hours ago, [x] cit said:

Hmmm, dont work in mine
with those line:
 

  Reveal hidden contents


/**
 * ExileServer_object_vehicle_carefulCreateVehicle
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicleClassName", "_position", "_direction", "_usePositionATL", "_temporaryPositionInOuterSpace", "_vehicleObject"];
_vehicleClassName = _this select 0;
_position = _this select 1;
_direction = _this select 2;
_usePositionATL = _this select 3;
_temporaryPositionInOuterSpace = 
[
	(_position select 0) - 250 + (random 500),
	(_position select 1) - 250 + (random 500),
	1000 + (random 1000)
];
_vehicleObject = createVehicle [_vehicleClassName, _temporaryPositionInOuterSpace, [], 0, "CAN_COLLIDE"];
_vehicleObject allowDamage false;
_vehicleObject removeAllEventHandlers "HandleDamage";
_vehicleObject addEventHandler["HandleDamage", {false}];
_vehicleObject setVelocity [0, 0, 0];
if ((typeName _direction) isEqualTo "ARRAY") then 
{
	_vehicleObject setVectorDirAndUp _direction;
}
else 
{
	_vehicleObject setDir _direction;
};
if (_usePositionATL) then
{
	_vehicleObject setPosATL _position;
}
else 
{
	_vehicleObject setPosASL _position;
};
_vehicleObject setVelocity [0, 0, 0];
_vehicleObject allowDamage true;
_vehicleObject removeAllEventHandlers "HandleDamage";
_vehicleObject setDamage 0;
clearBackpackCargoGlobal _vehicleObject;
clearItemCargoGlobal _vehicleObject;
clearMagazineCargoGlobal _vehicleObject;
clearWeaponCargoGlobal _vehicleObject;
//_licPlate = selectRandom [ "RU111", "BUZOVA_CAR", "ENTSRV.RU", "777", "666", "PVE-FOR_GIRLS" ]; _vehicleObject setPlateNumber _licPlate; не работает
if (_vehicleClassName isKindOf "I_UGV_01_F") then 
{
	createVehicleCrew _vehicleObject;
};
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "nightVision") isEqualTo 0) then 
{
	_vehicleObject disableNVGEquipment true;
};
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") isEqualTo 0) then 
{
	_vehicleObject disableTIEquipment true;
};
_vehicleObject

 

 

Might be the entry in the array with the "." in

Share this post


Link to post
Share on other sites

I try, no result
 

_licPlate = selectRandom [ "RU111", "BUZOVA_CAR", "ENTSRVRU", "777", "666", "PVE-FOR_GIRLS" ]; _vehicleObject setPlateNumber _licPlate;

 

Share this post


Link to post
Share on other sites

Wow!!! Its work. But only first entire 
But on veh from trader. When I try to spawn from Infi they  have standart plates

20180520111953_1.jpg

Edited by [x] cit

Share this post


Link to post
Share on other sites

Mine's not working either. Neither spawned vehicles nor purchased vehicles.   Is there a limit to the size of the array?  Does it only work for A3 vehicles?  Or third-party vehicles, too (e.g., Fox's vehicles)?

 

edit:  nevermind..... I forgot to add it to config.cpp.  It's working for purchased vehicles and spawned vehicles.   It doesn't always work on all third-party vehicles.   I guess it depends on whether the model was built to allow custom license plates.

Edited by Bob_the_K
  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.