Jump to content

[Release] Paint Vehicles


0verHeaT

Recommended Posts

Wondering the same thing!

 

No, Most Epoch added objects do not support objectTextures because they dotn have hiddenTextures.

 

However, it's being discussed to bring the option into 1.0.6 Epoch :)

 

But this require to change the actual model and config of the object ( CORE epoch)

Link to comment
Share on other sites

any news of the code for non single currency? :P

 

maca right clicks script

 

add:

	class IRStrobe {
		class PaintCar1 {
			text = "Paint Vehicle";
			script = "call player_paint;";
		};		
	};

change vehicleColourPaint.sqf to 

private ["_colour","_colour2","_playerWealth","_PUID","_txt"];
_PUID = (getPlayerUID player);

_toPaint =  vehicle player;
if(_toPaint != player &&  driver _toPaint == player )then {
if !([[[(ColourPrice select 0), (ColourPrice select 1)]],0] call epoch_returnChange) then {
	_txt = getText(configFile >> "CfgMagazines" >> (ColourPrice select 0) >> "displayName");
	titleText [format[(localize "STR_EPOCH_ACTIONS_12"), (ColourPrice select 1), _txt], "PLAIN DOWN"];
} else {
	_colour = ""+str((sliderPosition 5700) / 10)+","+str((sliderPosition 5701) / 10)+","+str((sliderPosition 5702) / 10)+",1";
	_colour2 = ""+str((sliderPosition 6700) / 10)+","+str((sliderPosition 6701) / 10)+","+str((sliderPosition 6702) / 10)+",1";
	
	PVDZE_veh_Colour = [_toPaint ,_colour,_colour2,_PUID,dayz_playerName];
	publicVariableServer "PVDZE_veh_Colour";
	player removeMagazines "IRStrobe";
	titleText ["Vehicle has been repainted! Please wait a moment for the texture to update!","PLAIN DOWN"];
};
}else{
cutText ["You need to be the driver to change the color.","plain"];
};

SPawn in a IRStrobe and right click it while being in a car

Link to comment
Share on other sites

maca right clicks script

 

add:

	class IRStrobe {
		class PaintCar1 {
			text = "Paint Vehicle";
			script = "call player_paint;";
		};		
	};

change vehicleColourPaint.sqf to 

private ["_colour","_colour2","_playerWealth","_PUID","_txt"];
_PUID = (getPlayerUID player);

_toPaint =  vehicle player;
if(_toPaint != player &&  driver _toPaint == player )then {
if !([[[(ColourPrice select 0), (ColourPrice select 1)]],0] call epoch_returnChange) then {
	_txt = getText(configFile >> "CfgMagazines" >> (ColourPrice select 0) >> "displayName");
	titleText [format[(localize "STR_EPOCH_ACTIONS_12"), (ColourPrice select 1), _txt], "PLAIN DOWN"];
} else {
	_colour = ""+str((sliderPosition 5700) / 10)+","+str((sliderPosition 5701) / 10)+","+str((sliderPosition 5702) / 10)+",1";
	_colour2 = ""+str((sliderPosition 6700) / 10)+","+str((sliderPosition 6701) / 10)+","+str((sliderPosition 6702) / 10)+",1";
	
	PVDZE_veh_Colour = [_toPaint ,_colour,_colour2,_PUID,dayz_playerName];
	publicVariableServer "PVDZE_veh_Colour";
	
	titleText ["Vehicle has been repainted! Please wait a moment for the texture to update!","PLAIN DOWN"];
};
}else{
cutText ["You need to be the driver to change the color.","plain"];
};

SPawn in a IRStrobe and right click it while being in a car

 

Thanks I Will try this tonight and let you know.

Link to comment
Share on other sites

Thanks I Will try this tonight and let you know.

 

this worked great thank you, I have however couple of questions one is how do you make the IRStrobe disapear after use? so that its like you get one use out of it every time you purchase it as at the moment it will be one purchase and use it forever.

 

my second question is what does color 2 paint exactly as it seem its only color 1 that works example:

 

if i use color green for the top section (color one) and red for the bottom (color 2) then the car comes out green ... it looks like color 2 is being ignored so my question is what is color 2 for?

Link to comment
Share on other sites

this worked great thank you, I have however couple of questions one is how do you make the IRStrobe disapear after use? so that its like you get one use out of it every time you purchase it as at the moment it will be one purchase and use it forever.

 

 

Try adding 

player removeMagazines "IRStrobe";

after the publicvariableserver in vehicleColourPaint.sqf

Link to comment
Share on other sites

How about back to the default?

 

make a button on the dialog to reset to default

 

then let that trigger a fnction that gets the vehicle config and texture data and let is set it back to that and update database to drop colors.

Link to comment
Share on other sites

How would I go about adding this in so you have to use a trader? I got a make shift garage type area and I want people using that rather then being able to do it on the fly

 

You can use something like this in your fn_selfActions

	if (_isMan and !_isPZombie and (_typeOfCursorTarget == "RU_Citizen2") and _canDo) then {   // <-- Change the trader guy here.
		if (s_player_paint < 0) then {
			s_player_paint = player addAction ["Paint", "Paint\player_paint_init.sqf", _cursorTarget, 5, false];
		};
	 } else {
		player removeAction s_player_paint;
		s_player_paint = -1;
	 };

replace your payer_paint.sqf with

private ["_txt","_coins","_vehicle","_nearvehicles"];
_nearvehicles = nearestObjects [(getPosATL player), ["ColourVehicles"], 15];
if ((count _nearvehicles) < 1) exitWith {cutText ["Did not find any vehicle!", "PLAIN DOWN"];}
VehicleToPaint = _nearvehicles select 0;
ColourPrice = 7500;
_coins = '...\dollars.paa';
_vehicle = getText(configFile >> "cfgVehicles" >> (typeOf VehicleToPaint) >> "displayName");
createdialog "VehicleColourDialog";
_txt = format ["<t>It will cost %1 <img image='%2'/><br/>to repaint your %3.</t>",[ColourPrice] call BIS_fnc_numberText,_coins,_vehicle];
((uiNamespace getVariable "VehicleColourDialog") displayCtrl 5703) ctrlSetStructuredText parseText _txt;
Link to comment
Share on other sites

A very simple solution is just to set these:

_obj setVariable["Colour","0",true];
_obj setVariable["Colour2","0",true];

to the selected vehicle.

However, this will only unpaint the vehicle on server restart.

not working.

 

vehicleColourPaintDefalt.sqf

private ["_PUID"];
_PUID = (getPlayerUID player);

	PVDZE_veh_Colour = [VehicleToPaint,"0","0",_PUID,dayz_playerName];
	publicVariableServer "PVDZE_veh_Colour";

	titleText ["ok. color be default after restart","PLAIN DOWN"];

in fn_selfActions.sqf

for what _this call player_paint;? why dont do right:

_paint = player addAction ["Paint", "scripts\paint\player_paint.sqf",_cursorTarget, 2, true, true, "", ""];

then

 

player_paint.sqf

VehicleToPaint = _this select 3;
Link to comment
Share on other sites

 

I have this working on my coin server

but on  my normal gold server I get this error

 

Error in expression <Paint\player_paint_init.sqf"
_this call player_paint;
>
  Error position: <player_paint;
>
  Error Undefined variable in expression: player_paint
File mpmissions\__CUR_MP.Tavi\Paint\player_paint_init.sqf, line 1

player_paint is defined in compiles correct ???

 

if (!isDedicated) then {
VehicleColourPaint = compile preprocessFileLineNumbers "Paint\vehicleColourPaint.sqf";
VehicleColourUpdate = compile preprocessFileLineNumbers "Paint\VehicleColourUpdate.sqf";
VehicleColourUpdate2 = compile preprocessFileLineNumbers "Paint\VehicleColourUpdate2.sqf";
player_paint = compile preprocessFileLineNumbers "Paint\player_paint.sqf";
"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
Link to comment
Share on other sites

All possible vehicles for repainting

 

in fn_selfActions.sqf

if (!(_typeOfCursorTarget in ColourVehicles) and !(_cursorTarget isKindOf "StaticWeapon")) then {
private ["_paint"];
_paint = player addAction [("<t color='#5882FA'>")+("Paint")+("</t>"), "scripts\paint\player_paint.sqf",_cursorTarget, -19, true, true, "", ""];
s_player_lockunlock set [count s_player_lockunlock,_paint];
};

in variables.sqf:

 

ColourVehicles = [
"SeaFox_EP1",
"smallboat_2",
"Smallboat_1",
"SeaFox",
"Fishing_Boat",
"PBX",
"Zodiac",
"RHIB2Turret",
"RHIB",
"BAF_FV510_W",
"BAF_FV510_D",
"BAF_Jackal2_GMG_W",
"BAF_Jackal2_L2A1_W",
"BAF_Offroad_W",
"Tractor",
"BAF_Jackal2_GMG_D",
"policecar",
"BAF_Jackal2_L2A1_D",
"BAF_Offroad_D",
"T55_TK_EP1",
"HMMWV_M2_USArmy",
"V3S_Open_TK_EP1",
"V3S_TK_EP1",
"SkodaBlue",
"SkodaRed",
"SkodaGreen",
"datsun1_civil_2_covered",
"datsun1_civil_3_open",
"tractorOld",
"hilux1_civil_2_covered",
"hilux1_civil_3_open",
"GAZ_Vodnik_HMG",
"GAZ_Vodnik",
"Lada1",
"MMT_USMC",
"MMT_Civ",
"M113Ambul_UN_EP1_DZ",
"TowingTractor",
"hilux1_civil_3_open_DZE4",
"hilux1_civil_2_covered_DZE4",
"hilux1_civil_3_open_DZE3",
"hilux1_civil_2_covered_DZE3",
"hilux1_civil_3_open_DZE2",
"hilux1_civil_3_open_DZE1",
"hilux1_civil_3_open_DZE",
"Lada1_DZE4",
"Lada1_DZE3",
"HMMWV_M1151_M2_CZ_DES_EP1",
"HMMWV_M998_crows_MK19_DES_EP1",
"Lada1_DZE2",
"LadaLM_DZE1",
"HMMWV_Terminal_EP1",
"Lada1_DZE1",
"Lada1_DZE1",
"datsun1_civil_3_open_DZE4",
"datsun1_civil_3_open_DZE3",
"LandRover_MG_TK_INS_EP1",
"datsun1_civil_2_covered_DZE3",
"LandRover_MG_TK_EP1",
"datsun1_civil_3_open_DZE2",
"LandRover_SPG9_TK_INS_EP1",
"datsun1_civil_2_covered_DZE2",
"LandRover_SPG9_TK_EP1",
"datsun1_civil_3_open_DZE1",
"datsun1_civil_2_covered_DZE1",
"datsun1_civil_2_covered_DZE",
"SkodaGreen_DZE4",
"ArmoredSUV_PMC",
"SkodaBlue_DZE4",
"SkodaGreen_DZE3",
"SkodaRed_DZE3",
"SkodaBlue_DZE3",
"SkodaBlue_DZE2",
"HMMWV_M1151_M2_CZ_DES_EP1_DZ",
"HMMWV_M1151_M2_CZ_DES_EP1_DZE",
"SkodaGreen_DZE1",
"LandRover_Special_CZ_EP1_DZ",
"SkodaRed_DZE1",
"LandRover_Special_CZ_EP1_DZE",
"SkodaBlue_DZE1",
"LandRover_MG_TK_EP1_DZ",
"Volha_1_TK_CIV_EP1_DZE4",
"Volha_1_TK_CIV_EP1_DZE1",
"LandRover_MG_TK_EP1_DZE",
"GAZ_Vodnik_DZ",
"ArmoredSUV_PMC_DZ",
"GAZ_Vodnik_DZE",
"ArmoredSUV_PMC_DZE",
"ArmoredSUV_PMC_DZ",
"MtvrRefuel_DZ",
"UralRefuel_TK_EP1_DZ",
"V3S_TK_EP1_DZE",
"AV8B2",
"CH_47F_EP1",
"CH_47F_EP1_DZE",
"MV22_DZ",
"UH1Y_DZ",
"Ka60_PMC",
"L39_TK_EP1",
"BAF_Apache_AH1_D",
"AW159_Lynx_BAF",
"CH_47F_BAF",
"CSJ_GyroP",
"CSJ_GyroCover",
"CSJ_GyroC"
];

 

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
×
×
  • Create New...