samp.directory
← Scripts and libraries

by-not/not_vehicle_system

All-in-one SA-MP and open.mp vehicle utility library: physical parts, 194 components/upgrades, singleplayer colors, and paintjobs for all 212 models.

Plugin★ 0updated yesterdayMITC++
Open on GitHub
Try it in the Pawn compiler →

Adds its include files, with the libraries it depends on, to the Pawn compiler in your browser, ready to include in a script.

README.md

not_vehicle_system

Language: English | Español

All-in-one vehicle utility library for SA-MP and open.mp covering all 212 GTA San Andreas vehicle models (400–611).

Features

  • Physical Vehicle Parts (VEH_PART_*): world/local coordinates, facing angles, player teleportation, range checks, and petrol cap side detection (with optional ColAndreas ground Z support).
  • Components & Upgrades: 14 component types, 194 component names (1000–1193), and a packed (char) compatibility table for all 212 models.
  • Singleplayer Colors: valid singleplayer color pairs per vehicle model, random picker, and combination validator.
  • Paintjobs: accurate SA-MP paintjob counts, lists, validation, and random selector (0–2; INVALID_PAINTJOB_ID = 3).
  • Zero external dependencies: requires only <a_samp>.

Installation

  1. Copy not_vehicle_system.inc into your pawno/include/ (or qawno/include/) directory.
  2. Include it after <a_samp>:
#include <a_samp>

// Optional: enable ColAndreas ground Z adjustment in GetPosNearVehiclePart
// #define COLANDREAS

#include <not_vehicle_system>

Quick Start

// Check if an upgrade is compatible with a vehicle
new model = GetVehicleModel(vehicleid);
if(IsVehicleUpgradeCompatible(model, 1000))
{
    AddVehicleComponent(vehicleid, 1000);
}

// List all compatible upgrades
new comps[VEH_MAX_COMPONENTS], count;
GetVehicleCompatibleUpgrades(411, comps, count);

// Teleport player beside the vehicle's petrol cap
SetPlayerNearVehiclePart(playerid, vehicleid, VEH_PART_PCAP);

// Apply a random valid color pair and paintjob
new c1, c2, pj;
if(GetVehicleRandomValidColor(model, c1, c2))
{
    ChangeVehicleColor(vehicleid, c1, c2);
}
if(GetVehicleRandomValidPaintjob(model, pj))
{
    ChangeVehiclePaintjob(vehicleid, pj);
}

API Summary

  • Parts: GetPosNearVehiclePart, GetVehiclePartPos, GetVehiclePartAngle, SetPlayerNearVehiclePart, IsPlayerNearVehiclePart, GetVehiclePetrolCapSide, GetVehiclePartName
  • Components: GetVehicleComponentTypeId, GetVehicleComponentTypeName, GetVehicleCompatibleTypes, GetVehicleComponentName, GetVehicleCompatibleUpgrades, GetVehicleCompatibleUpByType, IsVehicleUpgradeCompatible, IsVehicleHaveUpgrades
  • Colors: GetVehicleValidColors, GetVehicleRandomValidColor, IsValidVehicleColorCombination
  • Paintjobs: GetVehicleMaxPaintjobs, IsValidVehiclePaintjob, GetVehicleValidPaintjobs, GetVehicleRandomValidPaintjob
  • Utilities: EnsureVehicleComponents8687, CheckVehicleComponents8687

Credits

  • Combined and refactored by not.
  • Based on original SA-MP vehicle libraries by Ino, Walter-Correa, and ziggi.

License

Released under the MIT License.

gtasaopenmppawnsampvehicles

This page is built from what GitHub publishes about the repository. samp.directory does not host the code. Report a problem with this listing

by-not/not_vehicle_system: SA-MP Plugin | samp.directory