Quote from: jayant on May 27, 2015, 04:32 AMCode Selectelse if( cmd == "fix" )
{
local veh = player.Vehicle;
if (!veh) MessagePlayer("[#ffffff]You must be in a vehicle to fix your vehicle", player );
else if (veh.Health == 1000) MessagePlayer("Your vehicle is already in excellent condition." ,player);
else
{
veh.Health = 1000;
veh.Damage = 0;
MessagePlayer("[#ffffff]Your vehicle is fixed now",player);
}
}
Notice that you have defined veh = player.Vehicle, so you will use veh and that code gives error because there it is defined as Vehicle = player.Vehicle..So, to fix you will use if ( !Vehicle)
Hi,
So I have to also change veh.health == 1000.0 to Vehicle.health == 1000.0 ? and also veh.Fix() to Vehicle.Fix() ?
But the veh.fix works idk why does it needs to be changed only in that particular line which checks if the player is in vehicle ?
Thanks and Best Regards,
Pr0Ankit