Jump to content
Sign in to follow this  
jandrews

How to change vechiles color to black?

Recommended Posts

I have seen this in other servers, was wondering if its a script thing or a mod? could anyone link it please.

Share this post


Link to post
Share on other sites

Here's a demo mission.

functions\fn_colorStrider.sqf:

_vehicle = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_color = [_this, 1, "BLACK", [""]] call BIS_fnc_param;

   _colorCode = switch toUpper(_color) do {
       case "TAN": {[0,"#(argb,8,8,3)color(0.8,0.7,0.5,0.2)"]};
       case "BLACK": {[0,"#(argb,8,8,3)color(0,0,0,0.6)"]};
       case "PINK": {[0,"#(argb,8,8,3)color(1,0.75,0.84,0.2)"]};
   };

_vehicle setObjectTexture _colorCode;

cfgfunctions.hpp:

class TAG
{
tag = "TAG";
class functions
{
	file = "functions";
	class colorStrider {description = "Color vehicles different colors"; preInit = 1;};

};
};

description.ext:

class CfgFunctions
{
#include "cfgfunctions.hpp"
};

init field of vehicle:

_null = [[this, "BLACK"], "TAG_fnc_colorStrider", true, true] spawn BIS_fnc_MP;

Changing "BLACK" to "TAN" or whatever color you declare. Ends up like this:

gAhtRdD.jpg

Edited by kylania
MP fix

Share this post


Link to post
Share on other sites
init.sqf:

TAG_fnc_colorStrider = {
_vehicle = [_this, 0, objNull] call BIS_fnc_param;
_color = [_this, 1, ""] call BIS_fnc_param;

_colorCode = switch toUpper(_color) do {
	case "TAN": {[0,"#(argb,8,8,3)color(0.8,0.7,0.5,0.2)"]};
	case "BLACK": {[0,"#(argb,8,8,3)color(0,0,0,0.6)"]};
	case "PINK": {[0,"#(argb,8,8,3)color(1,0.75,0.84,0.2)"]};
};

_vehicle setObjectTexture _colorCode;
};

init field of vehicle:

_null = [[this, "BLACK"], "TAG_fnc_colorStrider", true, true] spawn BIS_fnc_MP;

Changing "BLACK" to "TAN" or whatever color you declare. Ends up like this:

http://i.imgur.com/gAhtRdD.jpg

Where can I find a list with all this functions for other vehicles?

I get an error Message TAG_fnc_colorStrider does not exist

Edited by Ghosthawk

Share this post


Link to post
Share on other sites

kylania you the man!!!.

So do I just change the vehicles name??? for example hunter HMG, offroad armed??

Share this post


Link to post
Share on other sites

Oh, wait, in multiplayer init.sqf is LAST, well after init fields, which is why you're getting that error. One sec, a demo would be easier.

---------- Post added at 11:36 AM ---------- Previous post was at 11:18 AM ----------

Ok, updated with a more MP usable version and a demo mission. :)

Share this post


Link to post
Share on other sites
Oh, wait, in multiplayer init.sqf is LAST, well after init fields, which is why you're getting that error. One sec, a demo would be easier.

---------- Post added at 11:36 AM ---------- Previous post was at 11:18 AM ----------

Ok, updated with a more MP usable version and a demo mission. :)

Is your demo at your website??

any chance you have a vehicle list? I was going to use this for hunter gmg and offroad armed?? thanks in advance.

Share this post


Link to post
Share on other sites

The demo is in the link in my first post in this thread. It has a Strider, Offroad and Hunter as examples.

Share this post


Link to post
Share on other sites

this does not allow me to save this file in my mission. It duplicates the mission file with only mission file in new saved file. Always reverts back to last saved point on mission. Unable to use this in any mission and save. ideas? and its doing it after i removed this file in mission. So any way I can save the missions from making a new mission folder and not saving?

Edited by JAndrews1

Share this post


Link to post
Share on other sites

I have no idea what you're talking about saving. Just add it to your mission and start the mission over from the beginning? Are you trying to add this to existing missions?

Share this post


Link to post
Share on other sites

ok. So now this issue is....since I had started to use this script in 2 missions i was making...it would change the vech. to black...great....but when I went to save it....it would not allow me and it re-saved it as a whole new file with the exact same name but only with "mission" file in the second saved "new file". I could not fix so I gave up for now.

SO now I decided to make a new mission since the other 2 are not working and I went to go save it....and (it does have this script in it)... and it continues to save it as another "new" file so I have a 2 files under the same name, 1 has original mission and 2nd is empty but with "mission" file in it.

updated, I have now tried a 4th mission this one without your script...it continues to make duplicate copies of file...this is new and since I started using this script and downloaded your demo mission. I have to scanned my pc and no bugs....what else may it be??? what would cause it to save the same mission into the exact same file but duplicate?

oh yes, I was adding this script to already existing missions but had not been finished.

Edited by JAndrews1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×