basdon.net aviation server


IP: basdon.net:7777 (How to join)[Log In]

Articles > Internal docs > SAMP internals

SAMP internals

Everything on this page is about SA-MP 0.3.7-R4

Client console commands

See samp.dll+690D0.

When launching SA-MP Debug (samp_debug.exe), following commands are also available:

Vehicle Categories (client)

Some vehicle things are handled differently by the client depending on the category of the vehicle. The category of a vehicle is determined at runtime by its vtable. SAMP defines following categories:

Full vehicle list
modelactual vtableassigned categoryvehicle name
4000x8711201Landstalker
4010x8711201Bravura
4020x8711201Buffalo
4030x8711201Linerunner
4040x8711201Perennial
4050x8711201Sentinel
4060x8717D80(1)Dumper
4070x8711201Fire Truck
4080x8711201Trashmaster
4090x8711201Stretch
4100x8711201Manana
4110x8711201Infernus
4120x8711201Voodoo
4130x8711201Pony
4140x8711201Mule
4150x8711201Cheetah
4160x8711201Ambulance
4170x8716803Leviathan
4180x8711201Moonbeam
4190x8711201Esperanto
4200x8711201Taxi
4210x8711201Washington
4220x8711201Bobcat
4230x8711201Mr Whoopee
4240x8711201BF Injection
4250x8716803Hunter
4260x8711201Premier
4270x8711201Enforcer
4280x8711201Securicar
4290x8711201Banshee
4300x8721A04Predator
4310x8711201Bus
4320x8711201Rhino
4330x8711201Barracks
4340x8711201Hotknife
4350x871C280Artic Trailer 1
4360x8711201Previon
4370x8711201Coach
4380x8711201Cabbie
4390x8711201Stallion
4400x8711201Rumpo
4410x8711201RC Bandit
4420x8711201Romero
4430x8711201Packer
4440x8717D80(1)Monster
4450x8711201Admiral
4460x8721A04Squalo
4470x8716803Seasparrow
4480x8713602Pizzaboy
4490x8723707Tram
4500x871C280Artic Trailer 2
4510x8711201Turismo
4520x8721A04Speeder
4530x8721A04Reefer
4540x8721A04Tropic
4550x8711201Flatbed
4560x8711201Yankee
4570x8711201Caddy
4580x8711201Solair
4590x8711201Berkley's RC Van
4600x8719485Skimmer
4610x8713602PCJ-600
4620x8713602Faggio
4630x8713602Freeway
4640x8719485RC Baron
4650x8716803RC Raider
4660x8711201Glendale
4670x8711201Oceanic
4680x8713602Sanchez
4690x8716803Sparrow
4700x8711201Patriot
4710x871AE80(1)Quadbike
4720x8721A04Coast Guard
4730x8721A04Dinghy
4740x8711201Hermes
4750x8711201Sabre
4760x8719485Rustler
4770x8711201ZR-350
4780x8711201Walton
4790x8711201Regina
4800x8711201Comet
4810x8715286BMX
4820x8711201Burrito
4830x8711201Camper
4840x8721A04Marquis
4850x8711201Baggage
4860x8711201Dozer
4870x8716803Maverick
4880x8716803News Chopper
4890x8711201Rancher
4900x8711201FBI Rancher
4910x8711201Virgo
4920x8711201Greenwood
4930x8721A04Jetmax
4940x8711201Hotring Racer
4950x8711201Sandking
4960x8711201Blista Compact
4970x8716803Police Maverick
4980x8711201Boxville
4990x8711201Benson
5000x8711201Mesa
5010x8716803RC Goblin
5020x8711201Hotring Racer A
5030x8711201Hotring Racer B
5040x8711201Bloodring Banger
5050x8711201Lure Rancher
5060x8711201Super GT
5070x8711201Elegant
5080x8711201Journey
5090x8715286Bike
5100x8715286Mountain Bike
5110x8719485Beagle
5120x8719485Cropduster
5130x8719485Stuntplane
5140x8711201Tanker
5150x8711201Roadtrain
5160x8711201Nebula
5170x8711201Majestic
5180x8711201Buccaneer
5190x8719485Shamal
5200x8719485Hydra
5210x8713602FCR-900
5220x8713602NRG-500
5230x8713602HPV1000
5240x8711201Cement Truck
5250x8711201Towtruck
5260x8711201Fortune
5270x8711201Cadrona
5280x8711201FBI Truck
5290x8711201Willard
5300x8711201Forklift
5310x8711201Tractor
5320x8711201Combine Harvester
5330x8711201Feltzer
5340x8711201Remington
5350x8711201Slamvan
5360x8711201Blade
5390x8719485Vortex
5400x8711201Vincent
5410x8711201Bullet
5420x8711201Clover
5430x8711201Sadler
5440x8711201Fire Truck Ladder
5450x8711201Hustler
5460x8711201Intruder
5470x8711201Primo
5480x8716803Cargobob
5490x8711201Tampa
5500x8711201Sunrise
5510x8711201Merit
5520x8711201Utility Van
5530x8719485Nevada
5540x8711201Yosemite
5550x8711201Windsor
5560x8717D80(1)Monster A
5570x8717D80(1)Monster B
5580x8711201Uranus
5590x8711201Jester
5600x8711201Sultan
5610x8711201Stratum
5620x8711201Elegy
5630x8716803Raindance
5640x8711201RC Tiger
5650x8711201Flash
5660x8711201Tahoma
5670x8711201Savanna
5680x8711201Bandito
5690x8711207Freight flat
5700x8711207Brown Streak Carriage
5710x8711201Kart
5720x8711201Mower
5730x8717D80(1)Dune
5740x8711201Sweeper
5750x8711201Broadway
5760x8711201Tornado
5770x8719485AT-400
5780x8711201DFT-30
5790x8711201Huntley
5800x8711201Stafford
5810x8713602BF-400
5820x8711201Newsvan
5830x8711201Tug
5840x871C280Tanker Trailer
5850x8711201Emperor
5860x8713602Wayfarer
5870x8711201Euros
5880x8711201Hotdog
5890x8711201Club
5900x8723707Freight box
5910x871C280Artic Trailer 3
5920x8719485Andromada
5930x8719485Dodo
5940x8711201RC Cam
5950x8721A04Launch
5960x8711201Police LS
5970x8711201Police SF
5980x8711201Police LV
5990x8711201Ranger
6000x8711201Picador
6010x8711201S.W.A.T.
6020x8711201Alpha
6030x8711201Phoenix
6040x8711201Damaged Glendale
6050x8711201Damaged Sadler
6060x871C280Baggage Box A
6070x871C280Baggage Box B
6080x871C280Tug Stairs
6090x8711201Black Boxville
6100x871C280Farm Trailer
6110x871C280Utility Trailer

Notes

(1) vehicles with a vtable that isn't one of the explicitely checked values are put in category 0. Besides all trailers, this also (maybe unexpectedly) includes Dumper, Monster, Monster A, Monster B, Quadbike, Dune. This is because the Dumper, Dune and all Monster vehicles are instances of CMonsterTruck and the Quadbike has its own unique CQuadBike class.

Vehicle damage status

See https://basdon.github.io/documented-samp-pawn-api/main.xml#Appendix_Vehicle_Damage_Status for an overview of vehicle support, behavior, and some quirks.

Server receiving damage from client

Server ignores damage status updates if it's not coming from the driver of the vehicle, otherwise it's applied and synced unconditionally and OnVehicleDamageStatusUpdate is invoked.

Client receiving damage from server

Behavior depends on the vehicle model it's being applied to, see also Vehicle categories. Most import to take into account: Dumper, Monster, Monster A, Monster B, Quadbike, Dune are categorized as "unknown", meaning none of their damage gets synced. The bumper may get damaged in the driver's game (or tires of a quad bike), but none of the other players will see any damage to that vehicle.

Client applies tire damage at CSampVehicle::ApplyVehicleDamageTires(char) with following behavior:

Client applies other damage at CSampVehicle::ApplyVehicleDamagePanelsDoorsLights(int,int,char) with following behavior:

Notes

(1) while CPlane inherits from CAutomobile, it overrides the Fix method yet SAMP still calls the base CAutomobile::Fix for CPlane instances. This is what causes the 'ghost door' effect(6) on some planes after doing RepairVehicle()(2) or updating damage status to 0 on planes.

For comparison, MTA dispatches to specific overridden methods based on the vehicle's model info:

if (pModelInfo->IsCar() || pModelInfo->IsMonsterTruck() || pModelInfo->IsTrailer())
    dwFunc = FUNC_CAutomobile__Fix(3);
else if (pModelInfo->IsPlane())
    dwFunc = FUNC_CPlane__Fix(3);
else if (pModelInfo->IsHeli())
    dwFunc = FUNC_CHeli__Fix(3);
else if (pModelInfo->IsBike())
    dwFunc = FUNC_CBike_Fix(3);

Source: https://github.com/multitheftauto/mtasa-blue/blob/bb0b32cb90f3379853fb9eab0a651caabd837d6f/Client/game_sa/CVehicleSA.cpp#L1120.

It also defines FUNC_CQuadBike__Fix(3), yet that is not used in the above.

(2) RepairVehicle(vehicleid) is implemented in SAMP by doing SetVehicleHealth(vehicleid, 1000.0); UpdateVehicleDamageStatus(vehicleid, 0, 0, 0, 0);.

(3) Implementations of the Fix proc:

(4) uiModelFlags mask 0x100 means NO_DOORS, as per data/handling.cfg comments (field modelFlags (af)).

(5) a damagemanager door value of 4 means that the door is removed/detached.

(6) https://basdon.github.io/documented-samp-pawn-api/main.xml#Appendix_Vehicle_Damage_Status_planeghostdoors

Category: Internal docs
SAMP internalsTables
CodePreprocessor Definitions
File formatsFlight file formatMap file formatTextdraw file format
ServicesEchoFlighttracker

This article has been accessed 19 time(s).
Main page Article index