Jump to content
  • 0

ajutor script


star69

Question

new MaxRepair = 1000;
new RepairMaxPrice = 1000;

public RepairPVehicle(playerid)
{
	new RepairMsg[128], Float:health;
	// Get the vehicle-id of the player's vehicle
	new vID = GetPlayerVehicleID(playerid);
	GetVehicleHealth(vID, health);
	// Calculate the amount of fuel that needs to be Repairled
	new Amount = MaxRepair - health;
	// Calculate the price to Repair
	new RepairPrice = (Amount * RepairMaxPrice) / MaxRepair;


	// Check if the player has enough cash
	if (PlayerInfo[playerid][pCash] >= RepairPrice)
	{
		// Repair the vehicle
		RepairVehicle(vID);
		// Withdraw the money from the player
		RewardPlayer(playerid, -RepairPrice, 0);
		// Let the player know he Repairled his vehicle
		format(RepairMsg, 128, TXT_RepairedVehicle, RepairPrice);
		SendClientMessage(playerid, 0xFFFFFFFF, RepairMsg);
	}
	else
	    SendClientMessage(playerid, 0xFFFFFFFF, TXT_CannotRepairVehicle);

	// Allow the player to move again
	TogglePlayerControllable(playerid, 1);

	return 1;
}

Ceva nu functioneaza cum trebuie.

Acest script repara masina, daca masina e stricata mai tare imi da bani cu - adica imi da bani in loc sa-mi ia si trece de limita impusa de mine MaxRepairPrice

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.