SA-MP Forums Archive
/hydraulics command help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /hydraulics command help (/showthread.php?tid=95061)



/hydraulics command help - indy-greg - 02.09.2009

The only thing that doesnt work with this command is that when the message is displayed for the vehicles not allowed to have hydraulics (You can't add Hydraulics to this vehicle!) it displays 'You now have hydraulics' aswell for some reason. Can someone please fix this minor bug.

Код:
dcmd_hydraulics(playerid,params[])
{
	#pragma unused params
	if(IsPlayerInInvalidPimpVehicle(playerid,GetPlayerVehicleID(playerid)))
  {
  SendClientMessage(playerid,COLOR_YELLOW,"You can't add Hydraulics to this vehicle!");
  }
  if(IsPlayerInAnyVehicle(playerid) == 0) //Checks if player is not in vehicle
  {
  SendClientMessage(playerid, 0xFFFF00AA, "Get a car first!");
  }
  else (AddVehicleComponent(GetPlayerVehicleID(playerid), 1087), SendClientMessage(playerid,COLOR_YELLOW,"You now have Hydraulics!"));
  return 1;
}



Re: /hydraulics command help - Jose 510 - 21.09.2009

Quote:
Originally Posted by indy-greg
The only thing that doesnt work with this command is that when the message is displayed for the vehicles not allowed to have hydraulics (You can't add Hydraulics to this vehicle!) it displays 'You now have hydraulics' aswell for some reason. Can someone please fix this minor bug.

Код:
dcmd_hydraulics(playerid,params[])
{
	#pragma unused params
	if(IsPlayerInInvalidPimpVehicle(playerid,GetPlayerVehicleID(playerid)))
  {
  SendClientMessage(playerid,COLOR_YELLOW,"You can't add Hydraulics to this vehicle!");
  }
  if(IsPlayerInAnyVehicle(playerid) == 0) //Checks if player is not in vehicle
  {
  SendClientMessage(playerid, 0xFFFF00AA, "Get a car first!");
  }
  else (AddVehicleComponent(GetPlayerVehicleID(playerid), 1087), SendClientMessage(playerid,COLOR_YELLOW,"You now have Hydraulics!"));
  return 1;
}
Look at this example:

Код:
new vehicleid;
	vehicleid = GetPlayerVehicleID(playerid);
	if(strcmp(cmdtext, "/tune", true) == 0)
	{
		AddVehicleComponent(vehicleid, 1080); // Switch ratlankiai
		AddVehicleComponent(vehicleid, 1086); // Stereo
		AddVehicleComponent(vehicleid, 1087); // Hydraulics
		SendClientMessage(playerid, 0xFF000090, "* Car tuned sucessfully!");
		return 1;
	}
	else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 402)
	{
		SendClientMessage(playerid, 0xFF000090, "You cant tune buffalo");
	}
its very identical to what you want. just edit it with the crap you need


Re: /hydraulics command help - Mikep. - 21.09.2009

pawn Код:
dcmd_hydraulics(playerid,params[])
{
  #pragma unused params
  if(IsPlayerInInvalidPimpVehicle(playerid,GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,COLOR_YELLOW,"You can't add hydraulics to this vehicle!");
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFF00AA, "Get a car first!");
  AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
  SendClientMessage(playerid,COLOR_YELLOW,"You now have Hydraulics!"));
  return 1;
}
Should work, untested.