[FilterScript] [FS] /tune (All modifiable vehicles supported)
#1

Tune!
So, this is my first release and I figured I would make something kinda useful.
/tune

Using a few functions I made, it will determine whether your car can be modified and what garage. Then it will teleport you to the garage where you can mod your car, once you have modded your car and exited the garage you will automatically be sent to where you used the /tune command.

Please, comment and test, my first release and I don't know whether it's good or bad, all I know is that it's simple and useful.

Download:http://pastebin.com/f493be4de

If anybody wants to upload it anywhere else feel free to, but I prefer paste bin, I will add links to this topic.


P.S: Many people may just want the following functions.

Код:
if(!IsPlayerInTransfenderVehicle(playerid, vehicleid))

if(!IsPlayerInLocolowVehicle(playerid, vehicleid))

if(!IsPlayerInWAAVehicle(playerid, vehicleid))
Check if the car is modifiable by the garage, WAA=Wheels arch angels.

Heres the functions.

Код:
IsPlayerInTransfenderVehicle(playerid,vehicleid)
{
  #define MAX_VALID_TRANSFENDER_VEHICLES 65

  new InTransfenderVehicle[MAX_VALID_TRANSFENDER_VEHICLES] =
  {
  400,401,402,404,405,409,410,411,415,418,419,420,421,422,424,426,436,438,439,
  442,445,451,458,466,467,474,475,477,478,479,480,489,491,492,496,500,505,506,
	507,516,517,518,527,526,529,533,540,541,542,545,546,547,549,550,551,555,575,
	579,580,585,587,589,600,602,603

  };

  vehicleid = GetPlayerVehicleID(playerid);

  if(IsPlayerInVehicle(playerid,vehicleid))
  {
		for(new i = 0; i < MAX_VALID_TRANSFENDER_VEHICLES; i++)
		{
		  if(GetVehicleModel(vehicleid) == InTransfenderVehicle[i])
		  {
		    return 0;
		  }
		}
  }
  return 1;
}

IsPlayerInLocolowVehicle(playerid,vehicleid)
{
  #define MAX_VALID_LOCOLOW_VEHICLES 7

  new InLocolowVehicle[MAX_VALID_LOCOLOW_VEHICLES] =
  {
	412,534,535,536,566,567,576
  };

  vehicleid = GetPlayerVehicleID(playerid);

  if(IsPlayerInVehicle(playerid,vehicleid))
  {
		for(new i = 0; i < MAX_VALID_LOCOLOW_VEHICLES; i++)
		{
		  if(GetVehicleModel(vehicleid) == InLocolowVehicle[i])
		  {
		    return 0;
		  }
		}
  }
  return 1;
}

IsPlayerInWAAVehicle(playerid,vehicleid)
{
  #define MAX_VALID_WAA_VEHICLES 6

  new InWAAVehicle[MAX_VALID_WAA_VEHICLES] =
  {
	558,559,560,561,562,565
  };

  vehicleid = GetPlayerVehicleID(playerid);

  if(IsPlayerInVehicle(playerid,vehicleid))
  {
		for(new i = 0; i < MAX_VALID_WAA_VEHICLES; i++)
		{
		  if(GetVehicleModel(vehicleid) == InWAAVehicle[i])
		  {
		    return 0;
		  }
		}
  }
  return 1;
}
Thanks alot,
NeRoSiS
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)