/hydraulics command help
#1

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;
}
Reply
#2

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
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)