open.mp | RepairVehicle
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文

RepairVehicle

warning

This function was added in SA-MP 0.3a and will not work in earlier versions!

Description

Fully repairs a vehicle, including visual damage (bumps, dents, scratches, popped tires etc.).

NameDescription
vehicleidThe ID of the vehicle to repair.

Returns

1: The function was executed successfully.

0: The function failed to execute. This means the vehicle specified does not exist.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/repair", cmdtext))
    {
        if (!IsPlayerInAnyVehicle(playerid))
        {
            return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
        }

        RepairVehicle(GetPlayerVehicleID(playerid));

        SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been repaired!");
        return 1;
    }
    return 0;
}

Related Functions

  • SetVehicleHealth: Set the health of a vehicle.
  • GetVehicleHealth: Check the health of a vehicle.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub