SA-MP Forums Archive
Vehicle Body fix - 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: Vehicle Body fix (/showthread.php?tid=318627)



Vehicle Body fix - viddo - 15.02.2012

Hello, in my gm when a mechanic /repair [Player id] [Price] only the engine can be fixed and the body is still wrecked, If anyone can help me in making a cmd like /fixbody [Player id] [Price] for the body fix and a /tunecar to tune vehicle with color + nitros and hydros.


Respuesta: Vehicle Body fix - admantis - 15.02.2012

Use the RepairVehicle function.


Re: Respuesta: Vehicle Body fix - viddo - 15.02.2012

Quote:
Originally Posted by admantis
Посмотреть сообщение
Use the RepairVehicle function.
ama COUGH noob COUGH, Cant you gimme the full code ?


Re: Respuesta: Vehicle Body fix - PrawkC - 16.02.2012

Quote:
Originally Posted by viddo
Посмотреть сообщение
ama COUGH noob COUGH, Cant you gimme the full code ?
Really the full code IS RepairVehicle(vehicleid)


Re: Vehicle Body fix - viddo - 16.02.2012

Uhmmm Here's the /repair script, Where should i add it ?

Код:
	if(strcmp(cmd, "/repair", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(PlayerInfo[playerid][pJob] != 7)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   You are not a Car Mechanic!");
		        return 1;
		    }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /repair [playerid/PartOfName] [price]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Price not lower then 1, or above 99999!"); return 1; }
			if(IsPlayerConnected(playa))
			{
			    if(playa != INVALID_PLAYER_ID)
			    {
			        if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa))
					{
					    if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "   Can't do that!"); return 1; }
				    	GetPlayerName(playa, giveplayer, sizeof(giveplayer));

					    format(string, sizeof(string), "* You offerd %s to fix his car for $%d .",giveplayer,money);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), "* Car Mechanic %s wants to repair your car for $%d, (type /accept repair) to accept.",sendername,money);
						SendClientMessage(playa, COLOR_WHITE, string);
						RepairOffer[playa] = playerid;
						RepairPrice[playa] = money;
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "   That player is not near you / not in a car.");
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   That player is offline.");
			}
		}
		return 1;
	}



AW: Vehicle Body fix - Littl3j0hNy - 16.02.2012

Show us your code for /accept repair ^^


Re: Vehicle Body fix - MP2 - 16.02.2012

Add it next to SetVehicleHealth.