SA-MP Forums Archive
Car colors 3 and 4? (example: camper) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car colors 3 and 4? (example: camper) (/showthread.php?tid=315359)



Car colors 3 and 4? (example: camper) - Virtual_Pancake - 02.02.2012

Is there any way to add car colors 3 and 4 to the /carcolour # # # command? They are just random but I would like to be able to change them.

This is what I got so far.

Here are some 4 color cars.

camper, 1,31,1,0, 1,31,1,0, 1,20,3,0, 1,5,0,0, 0,6,3,0, 3,6,3,0, 16,0,8,0, 17,0,120,0
cement, 60,24,23,0, 61,27,123,0, 65,31,31,0, 61,61,30,0, 81,35,23,0, 62,61,62,0, 83,66,64,0, 83,64,64,0
squalo, 0,0,0,1, 1,5,1,1, 3,3,0,1, 1,22,1,1, 1,35,1,1, 1,44,1,1, 1,53,1,1, 1,57,1,1

Код:
CMD:carcolour(playerid,params[])
{
	if(AccInfo[playerid][Level] >= 3)
	{
	    new Index;
	    new tmp[256];  tmp  = strtok(params,Index);
		new tmp2[256]; tmp2 = strtok(params,Index);
		new tmp3[256]; tmp3 = strtok(params,Index);
		new tmp4[256]; tmp4 = strtok(params,Index);
		new tmp5[256]; tmp5 = strtok(params,Index);

	    if(isnull(tmp) || isnull(tmp2) || isnull(tmp3) ||isnull(tmp4) ||isnull(tmp5) || !IsNumeric(tmp2)) return
		Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /carcolour [PlayerID] [Colour1] [Colour2] [Colour3] [Colour4]") &&
   	    Inter_SendClientMessage(playerid, orange, "Function: Will change vehicle colour of specified player");

		new player1 = strval(tmp), colour1, colour2, colour3, colour4, string[128];
		if(isnull(tmp2)) colour1 = random(126);
		else colour1 = strval(tmp2);
		if(isnull(tmp3)) colour2 = random(126);
		else colour2 = strval(tmp3);
		if(isnull(tmp4)) colour3 = random(126);
		else colour3 = strval(tmp4);
		if(isnull(tmp5)) colour4 = random(126);
		else colour4 = strval(tmp5);

		if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
		return Inter_SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
		{
            if(IsPlayerInAnyVehicle(player1))
			{
		       	SendCommandToAdmins(playerid,"CarColour");
				format(string, sizeof(string), "|- You have Changed the colour of \"%s's\" %s to '%d,%d,%d,%d' -|", PlayerName2(player1), VehicleNames[GetVehicleModel(GetPlayerVehicleID(player1))-400], colour1, colour2, colour3, colour4);
				Inter_SendClientMessage(playerid,BlueMsg,string);
				if(player1 != playerid)
				{
				format(string,sizeof(string),"|- Administrator \"%s\" has changed the Colour of your %s to '%d,%d,%d,%d'' -|", pName(playerid), VehicleNames[GetVehicleModel(GetPlayerVehicleID(player1))-400], colour1, colour2, colour3, colour4);
				Inter_SendClientMessage(player1,blue,string);
				}
   				return ChangeVehicleColor(GetPlayerVehicleID(player1), colour1, colour2, colour3, colour4);
			}
			else return Inter_SendClientMessage(playerid,red,"ERROR: Player is not in a vehicle");
	    }
		else return ErrorMessages(playerid, 2);
	}
	else return ErrorMessages(playerid, 1);
}



Re: Car colors 3 and 4? (example: camper) - Virtual_Pancake - 04.02.2012

Changed the includes as well with no luck.


Re: Car colors 3 and 4? (example: camper) - Virtual_Pancake - 06.02.2012

Is the 3rd and 4th car colors even controllable?


Re: Car colors 3 and 4? (example: camper) - sleepysnowflake - 06.02.2012

Yes, but only on specific cars. Let's say Savanna, the interior colour gets controled. There are also more cars but I just can't be arse to post them all in here. Anyways, the first 2 colours are the main ones so you want to use them.


Re: Car colors 3 and 4? (example: camper) - IceCube! - 06.02.2012

Re,oved the guy above beat me


Re: Car colors 3 and 4? (example: camper) - Virtual_Pancake - 06.02.2012

Quote:
Originally Posted by Berlovan
Посмотреть сообщение
Yes, but only on specific cars. Let's say Savanna, the interior colour gets controled. There are also more cars but I just can't be arse to post them all in here. Anyways, the first 2 colours are the main ones so you want to use them.
The Savanna only has two colors. I am talking about cars with 4 full color lines.

Two colors:
Код:
savanna, 97,96, 88,64, 90,96, 93,64, 97,96, 99,81, 102,114, 114,1
Four colors:
Код:
cement, 60,24,23,0, 61,27,123,0, 65,31,31,0, 61,61,30,0, 81,35,23,0, 62,61,62,0, 83,66,64,0, 83,64,64,0
As you can see, the color sequences are separated by spaces. For the cement truck, the first color sequence is "60,24,23,0". So that would mean that the truck when spawned with that color sequence would contain "light titanium poly", "steel grey poly", "winning silver poly" and "black".

As for the savanna, the first color sequence is only two colors, which happens to be "silver poly" and "light sapphire blue poly".

What I want to be able to do is control the two secondary colors on a 4 color vehicle, which would be "23,0" on the cement truck with the color sequence "60,24,23,0", AKA [colour1],[colour2],[colour3],[colour4].


Re: Car colors 3 and 4? (example: camper) - IceCube! - 06.02.2012

In SAMP Its impossible to control these colours as the developers such as Kalcor hasn't though of or found any need for these changes. Afterall its somthing like 4 - 7 cars with more than 2 colours right?


Re: Car colors 3 and 4? (example: camper) - Virtual_Pancake - 07.02.2012

Still would be nice to be able to change it. I am sure it can't be that hard to add.


Re: Car colors 3 and 4? (example: camper) - MP2 - 07.02.2012

Yes it would be nice.