Check car health help!
#2

I think something like this will be fine:
Under 'public OnPlayerExitVehicle(playerid, vehicleid)' you can just do the following code:

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
      new Float:health;
      health = GetVehicleHealth(vehicleid, health);

      // Maximum of health for car is 1000, so we go scripting things like this:

      if(health >= 400 && health < 500)
      {
            GivePlayerMoney(playerid, -250);
            SendClientMessage(playerid, 0xFF0000FF, "You've paid 250$ for the car problems you made.");
      }
      else if(health >= 500 && health < 650)
      {
            GivePlayerMoney(playerid, -750);
            SendClientMessage(playerid, 0xFF0000FF, "You've paid 750$ for the car problems you made.");
      }
      else if(health >= 650 && health < 800)
      {
            GivePlayerMoney(playerid, -1250);
            SendClientMessage(playerid, 0xFF0000FF, "You've paid 1250$ for the car problems you made.");
      }
      else if(health >= 800)
      {
            GivePlayerMoney(playerid, -1500);
            SendClientMessage(playerid, 0xFF0000FF, "You've paid 1500$ for the car problems you made.");
      }
      return 1;
}
I've made it here on the post, so don't except some grammar problems or whatever. Change the color to whatever you want and the prices to whatever you'd like.
Reply


Messages In This Thread
Check car health help! - by Giroud12 - 11.05.2013, 05:55
Re: Check car health help! - by Private200 - 11.05.2013, 06:21
Re: Check car health help! - by Giroud12 - 11.05.2013, 06:48

Forum Jump:


Users browsing this thread: 1 Guest(s)