11.05.2013, 05:55
How can i make when player exit vehicle...it check vehicle health and player need to pay how much the car health decreasing..
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;
}