samp.directory
← Scripts y librerías

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★ 0actualizado ayerMITC++
Abrir en GitHub
Probar en el compilador de Pawn →

Añade sus archivos include, con las librerías de las que depende, al compilador de Pawn de tu navegador, listos para incluirlos en un 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

Esta página se genera con lo que GitHub publica sobre el repositorio. samp.directory no aloja el código. Informar de un problema con esta ficha

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