API
branch: str
module-attribute
Represents the current branch.
debug: bool
module-attribute
Returns if the resource is in debug mode.
default_dimension: int
module-attribute
global_dimension: int
module-attribute
root_dir: str
module-attribute
The root directory of the server.
sdk_version: int
module-attribute
Represents the current SDK version.
version: str
module-attribute
Represents the current version.
Note
It's a slighty modified semantic versioning specification, which can be matched using this regular expression pattern ^(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))$
WeatherType
Bases: Enum
ExtraSunny = auto()
class-attribute
Clear = auto()
class-attribute
Clouds = auto()
class-attribute
Smog = auto()
class-attribute
Foggy = auto()
class-attribute
Overcast = auto()
class-attribute
Rain = auto()
class-attribute
Thunder = auto()
class-attribute
Clearing = auto()
class-attribute
Neutral = auto()
class-attribute
Snow = auto()
class-attribute
Blizzard = auto()
class-attribute
Snowlight = auto()
class-attribute
Xmas = auto()
class-attribute
Halloween = auto()
class-attribute
WeaponTint
Bases: Enum
Normal = auto()
class-attribute
Green = auto()
class-attribute
Gold = auto()
class-attribute
Pink = auto()
class-attribute
Army = auto()
class-attribute
LSPD = auto()
class-attribute
Orange = auto()
class-attribute
Platinum = auto()
class-attribute
VehicleModType
Bases: Enum
Spoiler = auto()
class-attribute
FrontBumper = auto()
class-attribute
RearBumper = auto()
class-attribute
SideSkirt = auto()
class-attribute
Exhaust = auto()
class-attribute
Frame = auto()
class-attribute
Grille = auto()
class-attribute
Hood = auto()
class-attribute
Fender = auto()
class-attribute
RightFender = auto()
class-attribute
Roof = auto()
class-attribute
Engine = auto()
class-attribute
Brakes = auto()
class-attribute
Transmission = auto()
class-attribute
Horn = auto()
class-attribute
Suspension = auto()
class-attribute
Armor = auto()
class-attribute
Unk1 = auto()
class-attribute
Turbo = auto()
class-attribute
Unk2 = auto()
class-attribute
TireSmoke = auto()
class-attribute
Unk3 = auto()
class-attribute
XenonLights = auto()
class-attribute
FrontWheels = auto()
class-attribute
BackWheels = auto()
class-attribute
Plateholder = auto()
class-attribute
VanityPlates = auto()
class-attribute
TrimDesign = auto()
class-attribute
Ornaments = auto()
class-attribute
Dashboard = auto()
class-attribute
Dial = auto()
class-attribute
DoorSpeaker = auto()
class-attribute
Seats = auto()
class-attribute
SteeringWheel = auto()
class-attribute
ColumnShifterLeavers = auto()
class-attribute
Plaques = auto()
class-attribute
Speakers = auto()
class-attribute
Trunk = auto()
class-attribute
Hydraulics = auto()
class-attribute
EngineBlock = auto()
class-attribute
AirFilter = auto()
class-attribute
Struts = auto()
class-attribute
ArchCover = auto()
class-attribute
Aerials = auto()
class-attribute
Trim = auto()
class-attribute
Tank = auto()
class-attribute
Windows = auto()
class-attribute
Unk4 = auto()
class-attribute
Livery = auto()
class-attribute
WindowTint
Bases: Enum
DarkSmoke = auto()
class-attribute
Green = auto()
class-attribute
LightSmoke = auto()
class-attribute
Limo = auto()
class-attribute
Clear = auto()
class-attribute
PureBlack = auto()
class-attribute
Stock = auto()
class-attribute
RadioStation
Bases: Enum
Nothing = auto()
class-attribute
RadioOff = auto()
class-attribute
MediaPlayer = auto()
class-attribute
TheMusicLocker = auto()
class-attribute
MotoMami = auto()
class-attribute
BlueArk = auto()
class-attribute
WorldWideFM = auto()
class-attribute
FlyLoFM = auto()
class-attribute
TheLowdown = auto()
class-attribute
TheLab = auto()
class-attribute
RadioMirrorPark = auto()
class-attribute
KultFM = auto()
class-attribute
Space = auto()
class-attribute
VinewoodBoulevardRadio = auto()
class-attribute
Blonded = auto()
class-attribute
LosSantosUndergroundRadio = auto()
class-attribute
iFruitRadio = auto()
class-attribute
LosSantosRockRadio = auto()
class-attribute
NonStopPopFM = auto()
class-attribute
RadioLosSantos = auto()
class-attribute
ChannelX = auto()
class-attribute
WestCoastTalkRadio = auto()
class-attribute
RebelRadio = auto()
class-attribute
SoulwaxFM = auto()
class-attribute
EastLosFM = auto()
class-attribute
WestCoastClassics = auto()
class-attribute
VehicleLockState
Bases: Enum
Nothing = auto()
class-attribute
Unlocked = auto()
class-attribute
Locked = auto()
class-attribute
LockoutPlayerOnly = auto()
class-attribute
LockPlayerInside = auto()
class-attribute
InitiallyLocked = auto()
class-attribute
ForceDoorsShut = auto()
class-attribute
LockedCanBeDamaged = auto()
class-attribute
VehicleDoor
Bases: Enum
DriverFront = auto()
class-attribute
PassengerFront = auto()
class-attribute
DriverRear = auto()
class-attribute
PassengerRear = auto()
class-attribute
Hood = auto()
class-attribute
Trunk = auto()
class-attribute
VehicleDoorState
Bases: Enum
Closed = auto()
class-attribute
OpenedLevel1 = auto()
class-attribute
OpenedLevel2 = auto()
class-attribute
OpenedLevel3 = auto()
class-attribute
OpenedLevel4 = auto()
class-attribute
OpenedLevel5 = auto()
class-attribute
OpenedLevel6 = auto()
class-attribute
OpenedLevel7 = auto()
class-attribute
Unknown = 255
class-attribute
VehiclePart
Bases: Enum
FrontLeft = auto()
class-attribute
FrontRight = auto()
class-attribute
MiddleLeft = auto()
class-attribute
MiddleRight = auto()
class-attribute
RearLeft = auto()
class-attribute
RearRight = auto()
class-attribute
VehiclePartDamage
Bases: Enum
NotDamaged = auto()
class-attribute
DamagedLevel1 = auto()
class-attribute
DamagedLevel2 = auto()
class-attribute
DamagedLevel3 = auto()
class-attribute
VehicleBumper
Bases: Enum
Front = auto()
class-attribute
Rear = auto()
class-attribute
VehicleBumperDamage
Bases: Enum
NotDamaged = auto()
class-attribute
Damaged = auto()
class-attribute
Nothing = auto()
class-attribute
NumberPlateStyle
Bases: Enum
BlueWhite = auto()
class-attribute
BlueWhite2 = auto()
class-attribute
BlueWhite3 = auto()
class-attribute
Yankton = auto()
class-attribute
YellowBlack = auto()
class-attribute
YellowBlue = auto()
class-attribute
Event
Bases: Enum
ServerStarted = 1
class-attribute
PlayerConnect = auto()
class-attribute
PlayerBeforeConnect = auto()
class-attribute
PlayerDisconnect = auto()
class-attribute
ConnectionQueueAdd = auto()
class-attribute
ConnectionQueueRemove = auto()
class-attribute
ResourceStart = auto()
class-attribute
ResourceStop = auto()
class-attribute
ResourceError = auto()
class-attribute
SyncedMetaChange = 13
class-attribute
StreamSyncedMetaChange = auto()
class-attribute
GlobalMetaChange = auto()
class-attribute
GlobalSyncedMetaChange = auto()
class-attribute
LocalMetaChange = auto()
class-attribute
PlayerDamage = auto()
class-attribute
PlayerDeath = auto()
class-attribute
Fire = auto()
class-attribute
Explosion = auto()
class-attribute
StartProjectile = auto()
class-attribute
WeaponDamage = auto()
class-attribute
VehicleDestroy = auto()
class-attribute
VehicleDamage = auto()
class-attribute
ColShape = 27
class-attribute
PlayerEnterVehicle = auto()
class-attribute
PlayerEnteringVehicle = auto()
class-attribute
PlayerLeftVehicle = auto()
class-attribute
PlayerChangeVehicleSeat = auto()
class-attribute
PlayerWeaponChange = auto()
class-attribute
PlayerRequestControl = auto()
class-attribute
VehicleAttach = auto()
class-attribute
VehicleDetach = auto()
class-attribute
NetOwnerChange = auto()
class-attribute
RemoveEntity = auto()
class-attribute
ConsoleCommand = 41
class-attribute
PlayerAnimationChange = auto()
class-attribute
PlayerInteriorChange = auto()
class-attribute
ExplosionType
Bases: Enum
Grenade = 0
class-attribute
GrenadeLauncher = auto()
class-attribute
StickyBomb = auto()
class-attribute
Molotov = auto()
class-attribute
Rocket = auto()
class-attribute
TankShell = auto()
class-attribute
HiOctane = auto()
class-attribute
Car = auto()
class-attribute
Plane = auto()
class-attribute
PetrolPump = auto()
class-attribute
Bike = auto()
class-attribute
DirSteam = auto()
class-attribute
DirFlame = auto()
class-attribute
DirWaterHydrant = auto()
class-attribute
DirGasCanister = auto()
class-attribute
Boat = auto()
class-attribute
ShipDestroy = auto()
class-attribute
Truck = auto()
class-attribute
Bullet = auto()
class-attribute
SmokeGrenadeLauncher = auto()
class-attribute
SmokeGrenade = auto()
class-attribute
BzGas = auto()
class-attribute
Flare = auto()
class-attribute
GasCanister = auto()
class-attribute
Extinguisher = auto()
class-attribute
ProgrammableAr = auto()
class-attribute
Train = auto()
class-attribute
Barrel = auto()
class-attribute
Propane = auto()
class-attribute
Blimp = auto()
class-attribute
DirFlameExplode = auto()
class-attribute
Tanker = auto()
class-attribute
PlaneRocket = auto()
class-attribute
VehicleBullet = auto()
class-attribute
GasTank = auto()
class-attribute
Firework = auto()
class-attribute
Snowball = auto()
class-attribute
ProxMine = auto()
class-attribute
ValkyrieCannon = auto()
class-attribute
Unknown = -1
class-attribute
BodyPart
Bases: Enum
Pelvis = auto()
class-attribute
LeftHip = auto()
class-attribute
LeftLeg = auto()
class-attribute
LeftFoot = auto()
class-attribute
RightHip = auto()
class-attribute
RightLeg = auto()
class-attribute
RightFoot = auto()
class-attribute
LowerTorso = auto()
class-attribute
UpperTorso = auto()
class-attribute
Chest = auto()
class-attribute
UnderNeck = auto()
class-attribute
LeftShoulder = auto()
class-attribute
LeftUpperArm = auto()
class-attribute
LeftElbrow = auto()
class-attribute
LeftWrist = auto()
class-attribute
RightShoulder = auto()
class-attribute
RightUpperArm = auto()
class-attribute
RightElbrow = auto()
class-attribute
RightWrist = auto()
class-attribute
Neck = auto()
class-attribute
Head = auto()
class-attribute
Unknown = -1
class-attribute
VehicleType
Bases: Enum
Invalid = auto()
class-attribute
Ped = auto()
class-attribute
Automobile = auto()
class-attribute
Plane = auto()
class-attribute
Trailer = auto()
class-attribute
QuadBike = auto()
class-attribute
SubmarineCar = auto()
class-attribute
AmphibiousAutomobile = auto()
class-attribute
AmphibiousQuadBike = auto()
class-attribute
Heli = auto()
class-attribute
Blimp = auto()
class-attribute
AutoGyro = auto()
class-attribute
Bike = auto()
class-attribute
BMX = auto()
class-attribute
Boat = auto()
class-attribute
Train = auto()
class-attribute
Submarine = auto()
class-attribute
Object = auto()
class-attribute
ColShapeType
Bases: Enum
Sphere = auto()
class-attribute
Cylinder = auto()
class-attribute
Circle = auto()
class-attribute
Cuboid = auto()
class-attribute
Rect = auto()
class-attribute
CheckpointCylinder = auto()
class-attribute
Polygon = auto()
class-attribute
BaseObjectType
Bases: Enum
Player = auto()
class-attribute
Vehicle = auto()
class-attribute
Blip = auto()
class-attribute
WebView = auto()
class-attribute
VoiceChannel = auto()
class-attribute
ColShape = auto()
class-attribute
Checkpoint = auto()
class-attribute
WebSocketClient = auto()
class-attribute
HttpClient = auto()
class-attribute
Audio = auto()
class-attribute
RmlElement = auto()
class-attribute
RmlDocument = auto()
class-attribute
LocalPlayer = auto()
class-attribute
BlipColor
Bases: Enum
White = auto()
class-attribute
Red = auto()
class-attribute
Green = auto()
class-attribute
Blue = auto()
class-attribute
Yellow = 5
class-attribute
LightRed = auto()
class-attribute
Violet = auto()
class-attribute
Pink = auto()
class-attribute
LightOrange = auto()
class-attribute
LightBrown = auto()
class-attribute
LightGreen = auto()
class-attribute
LightBlue = auto()
class-attribute
LightPurple = auto()
class-attribute
DarkPurple = auto()
class-attribute
Cyan = auto()
class-attribute
LightYellow = auto()
class-attribute
Organe = auto()
class-attribute
DarkPink = 19
class-attribute
GraniteGreen = auto()
class-attribute
DarkBrown = auto()
class-attribute
LightGray = auto()
class-attribute
LightPink = auto()
class-attribute
LemonGreen = auto()
class-attribute
ForestGreen = auto()
class-attribute
ElectricBlue = auto()
class-attribute
BrightPurple = auto()
class-attribute
DarkYellow = auto()
class-attribute
DarkCyan = 30
class-attribute
Beige = 36
class-attribute
DarkGray = 40
class-attribute
PinkRed = auto()
class-attribute
Gold = 46
class-attribute
Orange = auto()
class-attribute
BrilliantRose = auto()
class-attribute
MediumPurple = 50
class-attribute
Salmon = auto()
class-attribute
DarkGreen = auto()
class-attribute
BlizzardBlue = auto()
class-attribute
OracleBlue = auto()
class-attribute
Silver = auto()
class-attribute
EastBay = 58
class-attribute
YellowOrange = 60
class-attribute
MulberryPink = auto()
class-attribute
AltoGray = auto()
class-attribute
JellyBeanBlue = auto()
class-attribute
DarkOrange = auto()
class-attribute
Mamba = auto()
class-attribute
Default = auto()
class-attribute
TransparentBlack = 72
class-attribute
DeepRed = 76
class-attribute
TransparentRed = 79
class-attribute
TransparentBlue = 80
class-attribute
Purple = 83
class-attribute
BlipSprite
Bases: Enum
Higher = auto()
class-attribute
Lower = auto()
class-attribute
PolicePed = auto()
class-attribute
WantedRadius = auto()
class-attribute
Area = auto()
class-attribute
Centre = auto()
class-attribute
North = auto()
class-attribute
Waypoint = auto()
class-attribute
Radius = auto()
class-attribute
RadiusOutline = auto()
class-attribute
WeaponHigher = auto()
class-attribute
WeaponLower = auto()
class-attribute
HigherAI = auto()
class-attribute
LowerAI = auto()
class-attribute
PoliceHeliSpin = auto()
class-attribute
PolicePlaneMove = auto()
class-attribute
MPCrew = 27
class-attribute
MPFriendlies = auto()
class-attribute
CableCar = 36
class-attribute
Activities = auto()
class-attribute
Raceflag = auto()
class-attribute
Safehouse = 40
class-attribute
Police = auto()
class-attribute
PoliceChase = auto()
class-attribute
PoliceHeli = auto()
class-attribute
BombA = auto()
class-attribute
Snitch = 47
class-attribute
PlanningLocations = auto()
class-attribute
CriminalCarsteal = 50
class-attribute
CriminalDrugs = auto()
class-attribute
CriminalHoldups = auto()
class-attribute
CriminalPlayer = 54
class-attribute
CopPatrol = 56
class-attribute
CopPlayer = auto()
class-attribute
CriminalWanted = auto()
class-attribute
Heist = auto()
class-attribute
PoliceStation = auto()
class-attribute
Hospital = auto()
class-attribute
AssassinsMark = auto()
class-attribute
Elevator = auto()
class-attribute
Helicopter = auto()
class-attribute
RandomCharacter = 66
class-attribute
SecurityVan = auto()
class-attribute
TowTruck = auto()
class-attribute
IllegalParking = 70
class-attribute
Barber = auto()
class-attribute
CarModShop = auto()
class-attribute
ClothesStore = auto()
class-attribute
Tattoo = 75
class-attribute
ArmenianFamily = auto()
class-attribute
LesterFamily = auto()
class-attribute
MichaelFamily = auto()
class-attribute
TrevorFamily = auto()
class-attribute
JewelryHeist = auto()
class-attribute
DragRaceFinish = 82
class-attribute
Rampage = 84
class-attribute
VinewoodTours = auto()
class-attribute
LamarFamily = auto()
class-attribute
FranklinFamily = 88
class-attribute
ChineseStrand = auto()
class-attribute
FlightSchool = auto()
class-attribute
EyeSky = auto()
class-attribute
AirHockey = auto()
class-attribute
Bar = auto()
class-attribute
BaseJump = auto()
class-attribute
Basketball = auto()
class-attribute
BiolabHeist = 96
class-attribute
CabaretClub = 99
class-attribute
CarWash = auto()
class-attribute
ComedyClub = 102
class-attribute
Darts = auto()
class-attribute
DocksHeist = auto()
class-attribute
FbiHeist = auto()
class-attribute
FbiOfficersStrand = auto()
class-attribute
FinaleBankHeist = auto()
class-attribute
FinancierStrand = auto()
class-attribute
Golf = auto()
class-attribute
GunShop = auto()
class-attribute
InternetCafe = auto()
class-attribute
MichaelFamilyExile = auto()
class-attribute
NiceHouseHeist = auto()
class-attribute
RandomFemale = auto()
class-attribute
RandomMale = auto()
class-attribute
RuralBankHeist = 118
class-attribute
ShootingRange = auto()
class-attribute
SolomonStrand = auto()
class-attribute
StripClub = auto()
class-attribute
Tennis = auto()
class-attribute
TrevorFamilyExile = auto()
class-attribute
MichaelTrevorFamily = auto()
class-attribute
Triathlon = 126
class-attribute
OffRoadRacing = auto()
class-attribute
GangCops = auto()
class-attribute
GangMexicans = auto()
class-attribute
GangBikers = auto()
class-attribute
SnitchRed = 133
class-attribute
CriminalCuffKeys = auto()
class-attribute
Cinema = auto()
class-attribute
MusicVenue = auto()
class-attribute
PoliceStationBlue = auto()
class-attribute
Airport = auto()
class-attribute
CriminalSavedVehicle = auto()
class-attribute
WeedStash = auto()
class-attribute
Hunting = auto()
class-attribute
Pool = auto()
class-attribute
ObjectiveBlue = auto()
class-attribute
ObjectiveGreen = auto()
class-attribute
ObjectiveRed = auto()
class-attribute
ObjectiveYellow = auto()
class-attribute
ArmsDealing = auto()
class-attribute
MPFriend = auto()
class-attribute
CelebrityTheft = auto()
class-attribute
WeaponAssaultRifle = auto()
class-attribute
WeaponBat = auto()
class-attribute
WeaponGrenade = auto()
class-attribute
WeaponHealth = auto()
class-attribute
WeaponKnife = auto()
class-attribute
WeaponMolotov = auto()
class-attribute
WeaponPistol = auto()
class-attribute
WeaponRocket = auto()
class-attribute
WeaponShotgun = auto()
class-attribute
WeaponSmg = auto()
class-attribute
WeaponSniper = auto()
class-attribute
MPNoise = auto()
class-attribute
PointOfInterest = auto()
class-attribute
Passive = auto()
class-attribute
UsingMenu = auto()
class-attribute
GangCopsPartner = 171
class-attribute
WeaponMinigun = 173
class-attribute
WeaponArmour = 175
class-attribute
PropertyTakeover = auto()
class-attribute
GangMexicansHighlight = auto()
class-attribute
GangBikersHighlight = auto()
class-attribute
TriathlonCycling = auto()
class-attribute
TriathlonSwimming = auto()
class-attribute
PropertyTakeoverBikers = auto()
class-attribute
PropertyTakeoverCops = auto()
class-attribute
PropertyTakeoverVagos = auto()
class-attribute
Camera = auto()
class-attribute
CentreRed = auto()
class-attribute
HandcuffKeysBikers = auto()
class-attribute
HandcuffKeysVagos = auto()
class-attribute
HandcuffsClosedBikers = auto()
class-attribute
HandcuffsClosedVagos = auto()
class-attribute
CameraBadger = 192
class-attribute
CameraFacade = auto()
class-attribute
CameraIfruit = auto()
class-attribute
Yoga = 197
class-attribute
Taxi = auto()
class-attribute
Shrink = 205
class-attribute
Epsilon = auto()
class-attribute
FinancierStrandGrey = auto()
class-attribute
TrevorFamilyGrey = auto()
class-attribute
TrevorFamilyRed = auto()
class-attribute
FranklinFamilyGrey = auto()
class-attribute
FranklinFamilyBlue = auto()
class-attribute
FranklinA = auto()
class-attribute
FranklinB = auto()
class-attribute
FranklinC = auto()
class-attribute
GangVehicle = 225
class-attribute
GangVehicleBikers = auto()
class-attribute
GangVehicleCops = auto()
class-attribute
GangVehicleVagos = auto()
class-attribute
Gunca = auto()
class-attribute
DrivingBikers = auto()
class-attribute
DrivingCops = auto()
class-attribute
DrivingVagos = auto()
class-attribute
GangCopsHighlight = auto()
class-attribute
ShieldBikers = auto()
class-attribute
ShieldCops = 235
class-attribute
ShieldVagos = auto()
class-attribute
CustodyBikers = auto()
class-attribute
CustodyVagos = auto()
class-attribute
ArmsDealingAir = 251
class-attribute
PlayerStateArrested = auto()
class-attribute
PlayerStateCustody = auto()
class-attribute
PlayerStateDriving = auto()
class-attribute
PlayerStateKeyholder = auto()
class-attribute
PlayerStatePartner = auto()
class-attribute
Ztype = 262
class-attribute
Stinger = auto()
class-attribute
Packer = auto()
class-attribute
Monroe = auto()
class-attribute
Fairground = auto()
class-attribute
Property = auto()
class-attribute
GangHighlight = auto()
class-attribute
Altruist = auto()
class-attribute
AI = auto()
class-attribute
OnMission = auto()
class-attribute
CashPickup = auto()
class-attribute
Chop = auto()
class-attribute
Dead = auto()
class-attribute
TerritoryLocked = auto()
class-attribute
CashLost = auto()
class-attribute
CashVagos = auto()
class-attribute
CashCops = auto()
class-attribute
Hooker = auto()
class-attribute
Friend = auto()
class-attribute
Mission2to4 = auto()
class-attribute
Mission2to8 = auto()
class-attribute
Mission2to12 = auto()
class-attribute
Mission2to16 = auto()
class-attribute
CustodyDropOff = auto()
class-attribute
OnMissionCops = auto()
class-attribute
OnMissionLost = auto()
class-attribute
OnMissionVagos = auto()
class-attribute
CriminalCarStealCops = auto()
class-attribute
CriminalCarStealBikers = auto()
class-attribute
CriminalCarStealVagos = auto()
class-attribute
BandStrand = auto()
class-attribute
SimeonFamily = auto()
class-attribute
Mission1 = auto()
class-attribute
Mission2 = auto()
class-attribute
FriendDarts = auto()
class-attribute
FriendComedyClub = auto()
class-attribute
FriendCinema = auto()
class-attribute
FriendTennis = auto()
class-attribute
FriendStripClub = auto()
class-attribute
FriendLiveMusic = auto()
class-attribute
FriendGolf = auto()
class-attribute
BountyHit = auto()
class-attribute
UgcMission = auto()
class-attribute
Horde = auto()
class-attribute
CrateDrop = auto()
class-attribute
PlaneDrop = auto()
class-attribute
Sub = auto()
class-attribute
Race = auto()
class-attribute
Deathmatch = auto()
class-attribute
ArmWrestling = auto()
class-attribute
Mission1to2 = auto()
class-attribute
ShootingRangeGunShop = auto()
class-attribute
RaceAir = auto()
class-attribute
RaceLand = auto()
class-attribute
RaceSea = auto()
class-attribute
Tow = auto()
class-attribute
Garbage = auto()
class-attribute
Drill = auto()
class-attribute
Spikes = auto()
class-attribute
Firetruck = auto()
class-attribute
Minigun2 = auto()
class-attribute
Bugstar = auto()
class-attribute
Submarine = auto()
class-attribute
Chinook = auto()
class-attribute
GetawayCar = auto()
class-attribute
MissionBikers1 = auto()
class-attribute
MissionBikers1to2 = auto()
class-attribute
MissionBikers2 = auto()
class-attribute
MissionBikers2to4 = auto()
class-attribute
MissionBikers2to8 = auto()
class-attribute
MissionBikers2to12 = auto()
class-attribute
MissionBikers2to16 = auto()
class-attribute
MissionCops1 = auto()
class-attribute
MissionCops1to2 = auto()
class-attribute
MissionCops2 = auto()
class-attribute
MissionCops2to4 = auto()
class-attribute
MissionCops2to8 = auto()
class-attribute
MissionCops2to12 = auto()
class-attribute
MissionCops2to16 = auto()
class-attribute
MissionVagos1 = auto()
class-attribute
MissionVagos1to2 = auto()
class-attribute
MissionVagos2 = auto()
class-attribute
MissionVagos2to4 = auto()
class-attribute
MissionVagos2to8 = auto()
class-attribute
MissionVagos2to12 = auto()
class-attribute
MissionVagos2to16 = auto()
class-attribute
GangBike = auto()
class-attribute
GasGrenade = auto()
class-attribute
PropertyForSale = auto()
class-attribute
GangAttackPackage = auto()
class-attribute
MartinMadrazzo = auto()
class-attribute
EnemyHeliSpin = auto()
class-attribute
Boost = auto()
class-attribute
Devin = auto()
class-attribute
Dock = auto()
class-attribute
Garage = auto()
class-attribute
GolfFlag = auto()
class-attribute
Hangar = auto()
class-attribute
Helipad = auto()
class-attribute
JerryCan = auto()
class-attribute
Mask = auto()
class-attribute
HeistPrep = auto()
class-attribute
Incapacitated = auto()
class-attribute
SpawnPointPickup = auto()
class-attribute
Boilersuit = auto()
class-attribute
Completed = auto()
class-attribute
Rockets = auto()
class-attribute
GarageForSale = auto()
class-attribute
HelipadForSale = auto()
class-attribute
DockForSale = auto()
class-attribute
HangarForSale = auto()
class-attribute
Placeholder6 = auto()
class-attribute
Business = auto()
class-attribute
BusinessForSale = auto()
class-attribute
RaceBike = auto()
class-attribute
Parachute = auto()
class-attribute
TeamDeathmatch = auto()
class-attribute
RaceFoot = auto()
class-attribute
VehicleDeathmatch = auto()
class-attribute
Barry = auto()
class-attribute
Dom = auto()
class-attribute
Maryann = auto()
class-attribute
Cletus = auto()
class-attribute
Josh = auto()
class-attribute
Minute = auto()
class-attribute
Omega = auto()
class-attribute
Tonya = auto()
class-attribute
Paparazzo = auto()
class-attribute
Aim = auto()
class-attribute
CrateDropBackground = auto()
class-attribute
GreenAndNetPlayer1 = auto()
class-attribute
GreenAndNetPlayer2 = auto()
class-attribute
GreenAndNetPlayer3 = auto()
class-attribute
GreenAndFriendly = auto()
class-attribute
NetPlayer1AndNetPlayer2 = auto()
class-attribute
NetPlayer1AndNetPlayer3 = auto()
class-attribute
Creator = auto()
class-attribute
CreatorDirection = auto()
class-attribute
Abigail = auto()
class-attribute
Blimp = auto()
class-attribute
Repair = auto()
class-attribute
Testosterone = auto()
class-attribute
Dinghy = auto()
class-attribute
Fanatic = auto()
class-attribute
InfoIcon = 407
class-attribute
CaptureTheFlag = auto()
class-attribute
LastTeamStanding = auto()
class-attribute
Boat = auto()
class-attribute
CaptureTheFlagBase = auto()
class-attribute
CaptureTheFlagOutline = 413
class-attribute
CaptureTheFlagBaseNoBag = auto()
class-attribute
WeaponJerrycan = auto()
class-attribute
Rp = auto()
class-attribute
LevelInside = auto()
class-attribute
BountyHitInside = auto()
class-attribute
CaptureTheUSAFlag = auto()
class-attribute
CaptureTheUSAFlagOutline = auto()
class-attribute
Tank = auto()
class-attribute
PlayerHeli = auto()
class-attribute
PlayerPlane = auto()
class-attribute
PlayerJet = auto()
class-attribute
CentreStroke = auto()
class-attribute
PlayerGunCar = auto()
class-attribute
PlayerBoat = auto()
class-attribute
MPHeist = auto()
class-attribute
Temp1 = auto()
class-attribute
Temp2 = auto()
class-attribute
Temp3 = auto()
class-attribute
Temp4 = auto()
class-attribute
Temp5 = auto()
class-attribute
Temp6 = auto()
class-attribute
RaceStunt = auto()
class-attribute
HotProperty = auto()
class-attribute
UrbanWarfareVersus = auto()
class-attribute
KingOfTheCastle = auto()
class-attribute
PlayerKing = auto()
class-attribute
DeadDrop = auto()
class-attribute
PennedIn = auto()
class-attribute
Beast = auto()
class-attribute
EdgePointer = auto()
class-attribute
EdgeCrossTheLine = auto()
class-attribute
MPLamar = auto()
class-attribute
Bennys = auto()
class-attribute
CornerNumber1 = auto()
class-attribute
CornerNumber2 = auto()
class-attribute
CornerNumber3 = auto()
class-attribute
CornerNumber4 = auto()
class-attribute
CornerNumber5 = auto()
class-attribute
CornerNumber6 = auto()
class-attribute
CornerNumber7 = auto()
class-attribute
CornerNumber8 = auto()
class-attribute
Yacht = auto()
class-attribute
FindersKeepers = auto()
class-attribute
AssaultPackage = auto()
class-attribute
HuntTheBoss = auto()
class-attribute
Sightseer = auto()
class-attribute
TurretedLimo = auto()
class-attribute
BellyOfTheBeast = auto()
class-attribute
YachtLocation = auto()
class-attribute
PickupBeast = auto()
class-attribute
PickupZoned = auto()
class-attribute
PickupRandom = auto()
class-attribute
PickupSlowTime = auto()
class-attribute
PickupSwap = auto()
class-attribute
PickupThermal = auto()
class-attribute
PickupWeed = auto()
class-attribute
WeaponRailgun = auto()
class-attribute
Seashark = auto()
class-attribute
PickupHidden = auto()
class-attribute
Warehouse = auto()
class-attribute
WarehouseForSale = auto()
class-attribute
Office = auto()
class-attribute
OfficeForSale = auto()
class-attribute
Truck = auto()
class-attribute
Contraband = auto()
class-attribute
Trailer = auto()
class-attribute
VIP = auto()
class-attribute
Cargobob = auto()
class-attribute
AreaOutline = auto()
class-attribute
PickupAccelerator = auto()
class-attribute
PickupGhost = auto()
class-attribute
PickupDetonator = auto()
class-attribute
PickupBomb = auto()
class-attribute
PickupArmoured = auto()
class-attribute
Stunt = auto()
class-attribute
WeaponLives = auto()
class-attribute
StuntPremium = auto()
class-attribute
Adversary = auto()
class-attribute
BikerClubhouse = auto()
class-attribute
BikerCagedIn = auto()
class-attribute
BikerTurfWar = auto()
class-attribute
BikerJoust = auto()
class-attribute
ProductionWeed = auto()
class-attribute
ProductionCrack = auto()
class-attribute
ProductionFakeId = auto()
class-attribute
ProductionMeth = auto()
class-attribute
ProductionMoney = auto()
class-attribute
Package = auto()
class-attribute
Capture1 = auto()
class-attribute
Capture2 = auto()
class-attribute
Capture3 = auto()
class-attribute
Capture4 = auto()
class-attribute
Capture5 = auto()
class-attribute
Capture6 = auto()
class-attribute
Capture7 = auto()
class-attribute
Capture8 = auto()
class-attribute
Capture9 = auto()
class-attribute
Capture10 = auto()
class-attribute
Quad = auto()
class-attribute
Bus = auto()
class-attribute
DrugsPackage = auto()
class-attribute
PickupJump = auto()
class-attribute
Adversary4 = auto()
class-attribute
Adversary8 = auto()
class-attribute
Adversary10 = auto()
class-attribute
Adversary12 = auto()
class-attribute
Adversary16 = auto()
class-attribute
Laptop = auto()
class-attribute
PickupDeadline = auto()
class-attribute
SportsCar = auto()
class-attribute
WarehouseVehicle = auto()
class-attribute
RegPapers = auto()
class-attribute
PoliceStationDropoff = auto()
class-attribute
Junkyard = auto()
class-attribute
ExVech1 = auto()
class-attribute
ExVech2 = auto()
class-attribute
ExVech3 = auto()
class-attribute
ExVech4 = auto()
class-attribute
ExVech5 = auto()
class-attribute
ExVech6 = auto()
class-attribute
ExVech7 = auto()
class-attribute
TargetA = auto()
class-attribute
TargetB = auto()
class-attribute
TargetC = auto()
class-attribute
TargetD = auto()
class-attribute
TargetE = auto()
class-attribute
TargetF = auto()
class-attribute
TargetG = auto()
class-attribute
TargetH = auto()
class-attribute
Juggernaut = auto()
class-attribute
PickupRepair = auto()
class-attribute
SteeringWheel = auto()
class-attribute
Trophy = auto()
class-attribute
PickupRocketBoost = auto()
class-attribute
PickupHomingRocket = auto()
class-attribute
PickupMachinegun = auto()
class-attribute
PickupParachute = auto()
class-attribute
PickupTime5 = auto()
class-attribute
PickupTime10 = auto()
class-attribute
PickupTime15 = auto()
class-attribute
PickupTime20 = auto()
class-attribute
PickupTime30 = auto()
class-attribute
Supplies = auto()
class-attribute
PropertyBunker = auto()
class-attribute
GrWvm1 = auto()
class-attribute
GrWvm2 = auto()
class-attribute
GrWvm3 = auto()
class-attribute
GrWvm4 = auto()
class-attribute
GrWvm5 = auto()
class-attribute
GrWvm6 = auto()
class-attribute
GrCovertOps = auto()
class-attribute
AdversaryBunker = auto()
class-attribute
GrMocUpgrade = auto()
class-attribute
GrWUpgrade = auto()
class-attribute
SmCargo = auto()
class-attribute
SmHangar = auto()
class-attribute
TfCheckpoint = auto()
class-attribute
RaceTf = auto()
class-attribute
SmWp1 = auto()
class-attribute
SmWp2 = auto()
class-attribute
SmWp3 = auto()
class-attribute
SmWp4 = auto()
class-attribute
SmWp5 = auto()
class-attribute
SmWp6 = auto()
class-attribute
SmWp7 = auto()
class-attribute
SmWp8 = auto()
class-attribute
SmWp9 = auto()
class-attribute
SmWp10 = auto()
class-attribute
SmWp11 = auto()
class-attribute
SmWp12 = auto()
class-attribute
SmWp13 = auto()
class-attribute
SmWp14 = auto()
class-attribute
NhpBag = auto()
class-attribute
NhpChest = auto()
class-attribute
NhpOrbit = auto()
class-attribute
NhpVeh1 = auto()
class-attribute
NhpBase = auto()
class-attribute
NhpOverlay = auto()
class-attribute
NhpTurret = auto()
class-attribute
NhpMgFirewall = auto()
class-attribute
NhpMgNode = auto()
class-attribute
NhpWp1 = auto()
class-attribute
NhpWp2 = auto()
class-attribute
NhpWp3 = auto()
class-attribute
NhpWp4 = auto()
class-attribute
NhpWp5 = auto()
class-attribute
NhpWp6 = auto()
class-attribute
NhpWp7 = auto()
class-attribute
NhpWp8 = auto()
class-attribute
NhpWp9 = auto()
class-attribute
NhpCCTV = auto()
class-attribute
NhpStarterpack = auto()
class-attribute
NhpTurretConsole = auto()
class-attribute
NhpMgMirRotate = auto()
class-attribute
NhpMgMirStatic = auto()
class-attribute
NhpMgProxy = auto()
class-attribute
AcsrRaceTarget = auto()
class-attribute
AcsrRaceHotring = auto()
class-attribute
AcsrWp1 = auto()
class-attribute
AcsrWp2 = auto()
class-attribute
BatClubProperty = auto()
class-attribute
BatCargo = auto()
class-attribute
BatTruck = auto()
class-attribute
BatHackJewel = auto()
class-attribute
BatHackGold = auto()
class-attribute
BatKeypad = auto()
class-attribute
BatHackTarget = auto()
class-attribute
PickupDtbHealth = auto()
class-attribute
PickupDtbBlastIncrease = auto()
class-attribute
PickupDtbBlastDecrease = auto()
class-attribute
PickupDtbBombIncrease = auto()
class-attribute
PickupDtbBombDecrease = auto()
class-attribute
BatRivalClub = auto()
class-attribute
BatDrone = auto()
class-attribute
BatCashReg = auto()
class-attribute
CCTV = auto()
class-attribute
BatAssassinate = auto()
class-attribute
BatPbus = auto()
class-attribute
BatWp1 = auto()
class-attribute
BatWp2 = auto()
class-attribute
BatWp3 = auto()
class-attribute
BatWp4 = auto()
class-attribute
BatWp5 = auto()
class-attribute
BatWp6 = auto()
class-attribute
Blimp2 = auto()
class-attribute
Oppressor2 = auto()
class-attribute
BatWp7 = auto()
class-attribute
ArenaSeries = auto()
class-attribute
ArenaPremium = auto()
class-attribute
ArenaWorkshop = auto()
class-attribute
RaceWars = auto()
class-attribute
ArenaTurret = auto()
class-attribute
ArenaRCCar = auto()
class-attribute
ArenaRCWorkshop = auto()
class-attribute
ArenaTrapFire = auto()
class-attribute
ArenaTrapFlip = auto()
class-attribute
ArenaTrapSea = auto()
class-attribute
ArenaTrapTurn = auto()
class-attribute
ArenaTrapPit = auto()
class-attribute
ArenaTrapMine = auto()
class-attribute
ArenaTrapBomb = auto()
class-attribute
ArenaTrapWall = auto()
class-attribute
ArenaTrapBrd = auto()
class-attribute
ArenaTrapSbrd = auto()
class-attribute
ArenaBruiser = auto()
class-attribute
ArenaBrutus = auto()
class-attribute
ArenaCerberus = auto()
class-attribute
ArenaDeathbike = auto()
class-attribute
ArenaDominator = auto()
class-attribute
ArenaImpaler = auto()
class-attribute
ArenaImperator = auto()
class-attribute
ArenaIssi = auto()
class-attribute
ArenaSasquatch = auto()
class-attribute
ArenaScarab = auto()
class-attribute
ArenaSlamvan = auto()
class-attribute
ArenaZ = auto()
class-attribute
CheckpointType
Bases: Enum
CylinderSingleArrow = 0
class-attribute
CylinderDoubleArrow = auto()
class-attribute
CylinderTripleArrow = auto()
class-attribute
CylinderCycleArrow = auto()
class-attribute
CylinderCheckerboard = auto()
class-attribute
CylinderWrench = auto()
class-attribute
CylinderSingleArrow2 = auto()
class-attribute
CylinderDoubleArrow2 = auto()
class-attribute
CylinderTripleArrow2 = auto()
class-attribute
CylinderCycleArrow2 = auto()
class-attribute
CylinderCheckerboard2 = auto()
class-attribute
CylinderWrench2 = auto()
class-attribute
RingSingleArrow = auto()
class-attribute
RingDoubleArrow = auto()
class-attribute
RingTripleArrow = auto()
class-attribute
RingCycleArrow = auto()
class-attribute
RingCheckerboard = auto()
class-attribute
SingleArrow = auto()
class-attribute
DoubleArrow = auto()
class-attribute
TripleArrow = auto()
class-attribute
CycleArrow = auto()
class-attribute
Checkerboard = auto()
class-attribute
CylinderSingleArrow3 = auto()
class-attribute
CylinderDoubleArrow3 = auto()
class-attribute
CylinderTripleArrow3 = auto()
class-attribute
CylinderCycleArrow3 = auto()
class-attribute
CylinderCheckerboard3 = auto()
class-attribute
CylinderSingleArrow4 = auto()
class-attribute
CylinderDoubleArrow4 = auto()
class-attribute
CylinderTripleArrow4 = auto()
class-attribute
CylinderCycleArrow4 = auto()
class-attribute
CylinderCheckerboard4 = auto()
class-attribute
CylinderSingleArrow5 = auto()
class-attribute
CylinderDoubleArrow5 = auto()
class-attribute
CylinderTripleArrow5 = auto()
class-attribute
CylinderCycleArrow5 = auto()
class-attribute
CylinderCheckerboard5 = auto()
class-attribute
RingPlaneUp = auto()
class-attribute
RingPlaneLeft = auto()
class-attribute
RingPlaneRight = auto()
class-attribute
RingPlaneDown = auto()
class-attribute
Empty = auto()
class-attribute
Ring = auto()
class-attribute
Empty2 = auto()
class-attribute
Cylinder = auto()
class-attribute
Cylinder1 = auto()
class-attribute
Cylinder2 = auto()
class-attribute
Cylinder3 = auto()
class-attribute
Cylinder4 = auto()
class-attribute
Cylinder5 = auto()
class-attribute
Empty3 = auto()
class-attribute
Empty4 = auto()
class-attribute
Empty5 = auto()
class-attribute
Empty6 = auto()
class-attribute
RingDollar = auto()
class-attribute
RingWolf = auto()
class-attribute
RingQuestionMark = auto()
class-attribute
RingPlane = auto()
class-attribute
RingChopper = auto()
class-attribute
RingBoat = auto()
class-attribute
RingCar = auto()
class-attribute
RingBike = auto()
class-attribute
RingBicycle = auto()
class-attribute
RingTruck = auto()
class-attribute
RingParachute = auto()
class-attribute
RingJetpack = auto()
class-attribute
RingWhir = auto()
class-attribute
ConnectDeniedReason
Bases: Enum
WrongVersion = auto()
class-attribute
WrongBranch = auto()
class-attribute
DebugNotAllowed = auto()
class-attribute
WrongPassword = auto()
class-attribute
WrongCdnUrl = auto()
class-attribute
IVector2
Bases: TypedDict
x: float
class-attribute
y: float
class-attribute
Vector2
zero: Vector2
class-attribute
(0, 0) vector
one: Vector2
class-attribute
(1, 1) vector
up: Vector2
class-attribute
(0, 1) vector
down: Vector2
class-attribute
(0, -1) vector
left: Vector2
class-attribute
(-1, 0) vector
right: Vector2
class-attribute
(1, 0) vector
positive_infinity: Vector2
class-attribute
(inf, inf) vector
negative_infinity: Vector2
class-attribute
(-inf, -inf) vector
x() -> float
property
writable
y() -> float
property
writable
to_dict() -> IVector2
length() -> float
distance(vector: Vector2) -> float
distance_squared(vector: Vector2) -> float
lerp(vector: Vector2, ratio: float) -> Vector2
to_degrees(vector: Vector2) -> Vector2
to_radians(vector: Vector2) -> Vector2
is_in_range(vector: Vector2, range: float) -> bool
__neg__() -> Vector2
Negates vector.
Example
vector = alt.Vector2(1, 1)
alt.log(-vector) # Vector2(-1, -1)
__eq__(other: object) -> bool
Compares two vectors.
Example
vector = alt.Vector2(1, 1)
vector2 = alt.Vector2(1, 1)
alt.log(vector == vector2) # True
normalize() -> Vector2
angle_to(vector: Vector2) -> float
IVector3
Bases: TypedDict
x: float
class-attribute
y: float
class-attribute
z: float
class-attribute
Vector3
zero: Vector3
class-attribute
(0, 0, 0) vector
one: Vector3
class-attribute
(1, 1, 1) vector
up: Vector3
class-attribute
(0, 0, 1) vector
down: Vector3
class-attribute
(0, 0, -1) vector
left: Vector3
class-attribute
(-1, 0, 0) vector
right: Vector3
class-attribute
(1, 0, 0) vector
back: Vector3
class-attribute
(0, -1, 0) vector
forward: Vector3
class-attribute
(0, 1, 0) vector
positive_infinity: Vector3
class-attribute
(inf, inf, inf) vector
negative_infinity: Vector3
class-attribute
(-inf, -inf, -inf) vector
x() -> float
property
writable
y() -> float
property
writable
z() -> float
property
writable
to_dict() -> IVector3
length() -> float
distance(vector: Vector3) -> float
distance_squared(vector: Vector3) -> float
lerp(vector: Vector3, ratio: float) -> Vector3
to_degrees(vector: Vector3) -> Vector3
to_radians(vector: Vector3) -> Vector3
is_in_range(vector: Vector3, range: float) -> bool
__neg__() -> Vector3
Negates vector.
Example
vector = alt.Vector3(1, 1, 1)
alt.log(-vector) # Vector3(-1, -1, -1)
__eq__(other: object) -> bool
Compares two vectors.
Example
vector = alt.Vector3(1, 1, 1)
vector2 = alt.Vector3(1, 1, 1)
alt.log(vector == vector2) # True
normalize() -> Vector3
angle_to(vector: Vector3) -> float
FireInfo
Bases: TypedDict
pos: Vector3
class-attribute
weapon: int
class-attribute
RGBA(r: int, g: int, b: int, a: int = 255) -> None
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r |
int
|
An r component. |
required |
g |
int
|
An g component. |
required |
b |
int
|
An b component. |
required |
a |
int
|
An a component. |
255
|
Note
The RGBA values are alowed to range from 0 to 255.
r() -> int
property
writable
r component of RGBA
g() -> int
property
writable
g component of RGBA
b() -> int
property
writable
b component of RGBA
a() -> int
property
writable
a component of RGBA
to_bgra() -> RGBA
to_argb() -> RGBA
BaseObject
ref_count() -> int
property
Returns the ref count of the entity.
Raises:
Type | Description |
---|---|
RuntimeError
|
If the server is not in debug mode |
valid() -> bool
property
type() -> BaseObjectType
property
Type of the object.
delete_meta(key: str) -> None
Removes the specified key and the data connected to that specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the value to remove. |
required |
get_meta(key: str) -> Any
set_meta(key: str, value: Any) -> None
has_meta(key: str) -> bool
destroy() -> None
Removes the object from the world.
WorldObject
Bases: BaseObject
pos() -> Vector3
property
writable
Object position.
dimension() -> int
property
writable
Object dimension
Note
Check https://docs.altv.mp/articles/dimensions.html to understand how it works.
Entity
Bases: WorldObject
all: Sequence[Entity]
class-attribute
List with all entities.
Note
This creates a clone of the list everytime it is called. It is advised to call this once and store the result in a variable, before iterating over it.
Example
entities = alt.Entity.all
for entity in entities:
alt.log(entity.id)
id() -> int
property
Internal identificator of the entity which is identical on both sides.
rot() -> Vector3
property
writable
Entity rotation.
Note
Values are provided in radians.
streamed() -> bool
property
writable
Whether the entity should be streamed for other entities.
visible() -> bool
property
writable
Whether the entity is visible.
collision() -> bool
property
writable
frozen() -> bool
property
writable
model() -> int
property
writable
Entity model hash.
Note
Setter also accepts string as a value, but the getter will always return number
net_owner() -> Player | None
property
Network owner of the entity.
Note
Network owner is responsible for syncing entity with the server. It changes when actual network owner passes the migration range, then the new one is determined based on distance from the entity (if entity is a vehicle, then the driver will take priority for becoming network owner). Disabling migration range will stop this process from happening until turned on again.
get_by_id(id: int) -> Entity | None
staticmethod
set_net_owner(player: Player, disable_migration: bool = False) -> None
Changes network owner to the specified player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
player |
Player
|
The given player that will be set as new network owner. |
required |
disable_migration |
bool
|
Pass True to disable migration, False to keep it enabled. |
False
|
Note
See net_owner to understand how network owner works.
Keep in mind that disabling migration can lead to unexpected behaviour when the network owner gets out of the streaming range.
reset_net_owner(disable_migration: bool = False) -> None
Resets overwritten network owner.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
disable_migration |
bool
|
Pass True to disable migration, False to keep it enabled. |
False
|
Note
See net_owner to understand how network owner works.
Keep in mind that disabling migration can lead to unexpected behaviour when the network owner gets out of the streaming range.
attach_to(entity: Entity, entity_bone_id: int, own_bone_id: int, pos: Vector3, rot: Vector3, enable_collisions: bool, no_fixed_rotation: bool) -> None
Attaches this entity to another entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity
|
Target entity. |
required |
entity_bone_id |
int
|
Target bone id. |
required |
own_bone_id |
int
|
Origin bone id. |
required |
pos |
Vector3
|
Position offset. |
required |
rot |
Vector3
|
Rotation. |
required |
enable_collisions |
bool
|
If true the attached entity has a collision. |
required |
no_fixed_rotation |
bool
|
If false the entity is attached with a fixed rotation (no bouncing). That means if the value in native was true, you have to use false in the serverside method. |
required |
detach() -> None
Detaches the entity if attached to another entity.
get_synced_meta(key: str) -> Any
has_synced_meta(key: str) -> bool
set_synced_meta(key: str, value: Any) -> None
delete_synced_meta(key: str) -> None
Removes the specified key and the data connected to that specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the value to remove. |
required |
get_stream_synced_meta(key: str) -> Any
has_stream_synced_meta(key: str) -> bool
set_stream_synced_meta(key: str, value: Any) -> None
delete_stream_synced_meta(key: str) -> None
Removes the specified key and the data connected to that specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the value to remove. |
required |
Weapon
Bases: TypedDict
hash: int
class-attribute
tint_index: int
class-attribute
components: Set[int]
class-attribute
HeadOverlay
Bases: TypedDict
index: int
class-attribute
opacity: float
class-attribute
color_type: int
class-attribute
color_index: int
class-attribute
second_color_index: int
class-attribute
HeadBlendData
Bases: TypedDict
shape_first_id: int
class-attribute
shape_second_id: int
class-attribute
shape_third_id: int
class-attribute
skin_first_id: int
class-attribute
skin_second_id: int
class-attribute
skin_third_id: int
class-attribute
shape_mix: float
class-attribute
skin_mix: float
class-attribute
third_mix: float
class-attribute
Cloth
Bases: TypedDict
drawable: int
class-attribute
texture: int
class-attribute
palette: int
class-attribute
DlcCloth
Bases: TypedDict
dlc: int
class-attribute
drawable: int
class-attribute
texture: int
class-attribute
palette: int
class-attribute
Prop
Bases: TypedDict
drawable: int
class-attribute
texture: int
class-attribute
DlcProp
Bases: TypedDict
dlc: int
class-attribute
drawable: int
class-attribute
texture: int
class-attribute
Player
Bases: Entity
all: Sequence[Player]
class-attribute
List with all players connected to the server.
Note
This creates a clone of the list everytime it is called. It is advised to call this once and store the result in a variable, before iterating over it.
Example
players = alt.Player.all
for player in players:
alt.log(player.name)
name() -> str
property
ip() -> str
property
connected() -> bool
property
ping() -> int
property
social_id() -> int
property
hwid_hash() -> int
property
hwid_ex_hash() -> int
property
auth_token() -> str
property
move_speed() -> float
property
strafe_speed() -> float
property
forward_speed() -> float
property
aim_pos() -> Vector3
property
Position the player is currently aiming at.
Note
Will return zero if the player is aiming against an entity.
head_rot() -> Vector3
property
entity_aiming_at() -> Entity | None
property
entity_aim_offset() -> Vector3
property
invincible() -> bool
property
writable
in_vehicle() -> bool
property
vehicle() -> Vehicle | None
property
seat() -> int
property
health() -> int
property
writable
max_health() -> int
property
writable
armour() -> int
property
writable
max_armour() -> int
property
writable
current_weapon() -> int
property
writable
last_damaged_body_part() -> BodyPart
property
writable
current_weapon_tint_index() -> WeaponTint
property
current_weapon_tint_components() -> List[int]
property
weapons() -> List[Weapon]
property
dead() -> bool
property
jumping() -> bool
property
in_ragdoll() -> bool
property
aiming() -> bool
property
shooting() -> bool
property
reloading() -> bool
property
super_jump() -> bool
property
crouching() -> bool
property
stealthy() -> bool
property
flashlight_active() -> bool
property
head_blend_data() -> HeadBlendData
property
hair_color() -> int
property
hair_highlight_color() -> int
property
spawned() -> bool
property
current_animation_dict() -> int
property
current_animation_name() -> int
property
interior_location() -> int
property
get_by_id(id: int) -> Player | None
staticmethod
emit(event_name: str, *args: Any) -> None
kick(reason: str = 'Kicked') -> None
Forcefully disconnects the player with a reason message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reason |
str
|
The reason that will display to the player on the disconnect screen. |
'Kicked'
|
play_ambient_speech(speech_name: str, speech_param: str, speech_dict_hash: str) -> None
Plays ambient speech.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
speech_name |
str
|
Name of the speech. |
required |
speech_param |
str
|
Param of the speech. |
required |
speech_dict_hash |
str
|
Hash of the speech dict. |
required |
Note
See https://github.com/DurtyFree/gta-v-data-dumps/blob/master/speeches.json for a full list of speeches.
set_date_time(day: int, month: int, year: int, hour: int, minute: int, second: int) -> None
set_weather(weather: WeatherType | int) -> None
set_into_vehicle(vehicle: Vehicle, seat: int) -> None
Set the player into a vehicle on specific seat.
clear_blood_damage() -> None
Removes the visible blood on the player body.
give_weapon(weapon_hash: int, ammo: int, equip_now: bool) -> None
Gives the specified weapon to the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
weapon_hash |
int
|
Hash of the weapon. |
required |
ammo |
int
|
Amount of ammo to spawn the weapon with. See note for more information |
required |
equip_now |
bool
|
Should the weapon be equipped immediately. |
required |
Note
Amount of given ammo is shared between all weapons with the same ammo type. For example pistols: weapon_pistol
and weapon_combatpistol
have same ammo pool.
Some more notes about weapon ammo:
- Zero ammo value doesn't remove ammo of that weapon.
- Negative ammo value enables infinite ammo for this ammo type.
- Amount of ammo will be added if player already have weapon with same ammo type.
Example
player.give_weapon(alt.hash("weapon_pistol"), 10, True) # sets amount ammo of type "AMMO_PISTOL" to 10
player.give_weapon(alt.hash("weapon_combatpistol"), 10, True) # also 10 amount of ammo, as this has the same type of ammo
player.give_weapon(alt.hash("weapon_pistol"), 10, True) # adds amount ammo of type "AMMO_PISTOL", so 20 pistol ammo in result
remove_weapon(weapon_hash: int) -> None
Removes the specified weapon from the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
weapon_hash |
int
|
Hash of the weapon. |
required |
remove_all_weapons() -> None
Removes every weapon from the player.
set_weapon_tint_index(weapon_hash: int, tint_index: WeaponTint | int) -> None
add_weapon_component(weapon_hash: int, component: int) -> None
remove_weapon_component(weapon_hash: int, component: int) -> None
set_head_overlay(overlay_id: int, index: int, opacity: float) -> bool
remove_head_overlay(overlay_id: int) -> bool
set_head_overlay_color(overlay_id: int, color_type: int, color_index: int, second_color_index: int) -> bool
get_head_overlay(overlay_id: int) -> HeadOverlay
set_face_feature(index: int, scale: float) -> bool
get_face_feature_scale(index: int) -> float
remove_face_feature(index: int) -> bool
set_head_blend_palette_color(id: int, red: int, green: int, blue: int) -> bool
get_head_blend_palette_color(id: int) -> RGBA
set_head_blend_data(shape_first_id: int, shape_second_id: int, shape_third_id: int, skin_first_id: int, skin_second_id: int, skin_third_id: int, shape_mix: float, skin_mix: float, third_mix: float) -> None
set_eye_color(eye_color: int) -> bool
get_eye_color() -> int
get_clothes(component: int) -> Cloth
Gets the specified clothing component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the clothing. |
required |
Returns:
Type | Description |
---|---|
Cloth
|
The currently equipped clothing component |
Example
cloth = player.get_clothes(1) # Gets the currently equipped mask
alt.log(cloth.drawable) # Logs the drawable of the currently equipped mask
set_clothes(component: int, drawable: int, texture: int, palette: int = 0) -> bool
Sets the specified clothing component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the clothing. |
required |
drawable |
int
|
Drawable id of the clothing. |
required |
texture |
int
|
Texture id of the clothing. |
required |
palette |
int
|
Palette of the clothing. |
0
|
Example
player.set_clothes(1, 14, 0) # Sets the players mask to a blue hockey mask
get_dlc_clothes(component: int) -> DlcCloth
Gets the specified dlc clothing component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the clothing. |
required |
Returns:
Type | Description |
---|---|
DlcCloth
|
The currently equipped dlc clothing component |
Example
cloth = player.get_dlc_clothes(1) # Gets the currently equipped mask
alt.log(cloth.drawable) # Logs the drawable of the currently equipped mask
set_dlc_clothes(dlc: int, component: int, drawable: int, texture: int, palette: int = 2) -> bool
Sets the specified dlc clothing component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dlc |
int
|
Dlc hash of the clothing |
required |
component |
int
|
Component id of the clothing. |
required |
drawable |
int
|
Drawable id of the clothing. |
required |
texture |
int
|
Texture id of the clothing. |
required |
palette |
int
|
Palette of the clothing. |
2
|
Example
player.set_dlc_clothes(alt.hash("dlcname"), 1, 14, 0)
get_prop(component: int) -> Prop
Gets the specified prop component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the prop. |
required |
Returns:
Type | Description |
---|---|
Prop
|
The prop component |
Example
prop = player.get_prop(0) # Gets the hat prop of the player
alt.log(prop.drawable) # Logs the drawable id of the current hat prop of the player
set_prop(component: int, drawable: int, texture: int) -> bool
Sets the specified prop component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the prop. |
required |
drawable |
int
|
Drawable id of the prop. |
required |
texture |
int
|
Texture id of the prop. |
required |
Example
player.set_prop(0, 13, 0) # sets the players hat prop to a blue cowboy hat
get_dlc_prop(component: int) -> DlcProp
Gets the specified dlc prop component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the prop. |
required |
Returns:
Type | Description |
---|---|
DlcProp
|
The dlc prop component |
Example
prop = player.get_dlc_prop(0) # Gets the hat prop of the player
alt.log(prop.drawable) # Logs the drawable id of the current hat prop of the player
set_dlc_prop(dlc: int, component: int, drawable: int, texture: int) -> bool
Sets the specified dlc prop component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dlc |
int
|
Dlc hash of the prop |
required |
component |
int
|
Component id of the prop. |
required |
drawable |
int
|
Drawable id of the prop. |
required |
texture |
int
|
Texture id of the prop. |
required |
Example
player.set_dlc_prop(alt.hash("dlcname"), 0, 13, 0)
clear_prop(component: int) -> None
Removes a specified prop component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
int
|
Component id of the prop. |
required |
Example
player.clear_prop(0) # removes the player hat prop
is_entity_in_streaming_range(entity: Entity | int) -> bool
Checks whether the given entity is in the stream range of the player.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entity |
Entity | int
|
Entity object or it's id |
required |
Example
if player.in_vehicle:
alt.log(player.is_entity_in_streaming_range(player.vehicle)) # This always logs True, because their own vehicle is always in stream range of the player
despawn() -> None
get_local_meta(key: str) -> Any
has_local_meta(key: str) -> bool
set_local_meta(key: str, value: Any) -> None
delete_local_meta(key: str) -> None
Neon
Bases: TypedDict
left: bool
class-attribute
right: bool
class-attribute
front: bool
class-attribute
back: bool
class-attribute
Vehicle
Bases: Entity
all: Sequence[Vehicle]
class-attribute
List with all vehicles.
Note
This creates a clone of the list everytime it is called. It is advised to call this once and store the result in a variable, before iterating over it.
Example
vehicles = alt.Vehicle.all
for vehicle in vehicles:
alt.log(vehicles.model)
modkit() -> int
property
writable
Gets or sets the current mod kit of a vehicle.
primary_color() -> int
property
writable
Gets or sets the current primary color of a vehicle.
primary_color_rgb() -> RGBA
property
writable
Gets or sets the custom primary color as an RGBA type.
Example
vehicle = alt.Vehicle("elegy", 0, 0, 0, 0, 0, 0)
vehicle.primary_color_rgb = alt.RGBA(255, 0, 0)
alt.log("Vehicle primary color RGB was set to red")
secondary_color() -> int
property
writable
Gets or sets the current secondary color.
secondary_color_rgb() -> RGBA
property
writable
Gets or sets the custom secondary color as an RGBA type.
Example
vehicle = alt.Vehicle("elegy", 0, 0, 0, 0, 0, 0)
vehicle.secondary_color_rgb = alt.RGBA(255, 0, 0)
alt.log("Vehicle secondary color RGB was set to red")
pearl_color() -> int
property
writable
Gets or sets the pearl color of a vehicle.
wheel_color() -> int
property
writable
Gets or sets the wheel color.
interior_color() -> int
property
writable
Gets or sets the interior color of a vehicle.
dashboard_color() -> int
property
writable
Gets or sets the dashboard color of the vehicle. Dashboard colors range from 0 to 159.
Example
vehicle = alt.Vehicle("elegy", 0, 0, 0, 0, 0, 0)
vehicle.dashboard_color = 139
tire_smoke_color() -> RGBA
property
writable
Gets or sets the color of the tire smoke.
custom_tires() -> bool
property
writable
Gets or sets if the vehicle instance has custom tires.
darkness() -> int
property
writable
Applies some decoration effects to the vehicle (e.g.: It makes the hydra looking rusty or applies snow to the front bumper of policeold1). Does not work on every vehicle model.
Example
vehicle = alt.Vehicle('elegy', 0, 0, 0, 0, 0, 0)
vehicle.darkness = 500;
number_plate_index() -> NumberPlateStyle
property
writable
Gets or sets the current number plate style.
number_plate_text() -> str
property
writable
Gets or sets the current text displayed on the number plate.
window_tint() -> WindowTint
property
writable
Gets or sets the window tint of a vehicle.
dirt_level() -> int
property
writable
Gets or sets the dirt level of the vehicle.
neon() -> Neon
property
writable
Enables or disables a neon light on a specific position.
neon_color() -> RGBA
property
writable
Gets or sets the color of the neon lights.
livery() -> int
property
writable
Gets or sets the livery of a vehicle.
roof_livery() -> int
property
writable
Gets or sets the roof livery of a vehicle.
game_state_base64() -> str
property
writable
Gets or sets the game state data of a vehicle as a base64 string.
Returns:
Type | Description |
---|---|
str
|
A base64 string of the game state data. |
Note
Base64 methods are deprecated.
appearance_data_base64() -> str
property
writable
Gets or sets the appearance of a vehicle as a base64 string.
Returns:
Type | Description |
---|---|
str
|
A base64 string. |
Note
Base64 methods are deprecated.
health_data_base64() -> str
property
writable
Gets or sets the health data of a vehicle as a base64 string.
Returns:
Type | Description |
---|---|
str
|
A base64 string of the health data. |
Note
Base64 methods are deprecated.
damage_data_base64() -> str
property
writable
Gets or sets the damage status of a vehicle as a base64 string.
Returns:
Type | Description |
---|---|
str
|
A base64 string of the damage status. |
Note
Base64 methods are deprecated.
script_data_base64() -> str
property
writable
Gets or sets the script data of a vehicle as a base64 string.
Returns:
Type | Description |
---|---|
str
|
A base64 string of the script data. |
Note
Base64 methods are deprecated.
engine_on() -> bool
property
writable
Gets or sets the engine state of the vehicle. The functionality of the vehicle engine can be triggered on either client-side or server-side. If you want to trigger the engine on client-side use native.setVehicleEngineOn.
Example
vehicle = alt.Vehicle('elegy', 0, 0, 0, 0, 0, 0)
vehicle.engine_on = True;
headlight_color() -> int
property
writable
Gets or sets the headlight color of a vehicle.
active_radio_station() -> RadioStation
property
writable
Gets or sets the active radio station.
Example
vehicle = alt.Vehicle.all[0]
station = vehicle.active_radio_station
alt.log(f"Current station: {station}")
vehicle.active_radio_station = alt.RadioStation.RadioOff
alt.log("Vehicle radio station was turned off.")
siren_active() -> bool
property
writable
Gets or sets the siren state of a vehicle.
lock_state() -> VehicleLockState
property
writable
Gets or sets the lock state of a vehicle.
roof_state() -> int
property
writable
Gets or sets the roof state of a vehicle (closed or open).
lights_multiplier() -> float
property
writable
Gets or sets the lights intensity and distance of a vehicle.
engine_health() -> int
property
writable
Gets or sets the current engine health.
Default maximum engine health is 1000.
The vehicle.repair()
function should be used to repair a vehicle if the engine health is less than or equal to zero.
This example demonstrates that when you drive through a ColShape it will repair the vehicle.
Example
colshape = alt.ColShape.circle(-1295.9208984375, 86.0835189819336, 2)
colshape.set_meta("repairVehicles", True)
@alt.event(alt.Event.ColShape)
def colshape_func(colshape: alt.ColShape, entity: alt.Entity, enter: bool):
if not isinstance(entity, alt.Vehicle) or not enter or not colshape.get_meta("repairVehicles"):
return
if entity.destroyed:
entity.repair()
alt.log("Repaired Destroyed Vehicle")
return
entity.engine_health = 1000
alt.log("Repaired Vehicle")
petrol_tank_health() -> int
property
writable
Gets or sets the current health amount of the petrol tank.
body_health() -> int
property
writable
Gets or sets the body health.
body_additional_health() -> int
property
writable
Gets or sets the additional body health.
manual_engine_control() -> bool
property
writable
Enables or disables the manual engine control.
drift_mode_enabled() -> bool
property
writable
Gets or sets the drift mode state of the vehicle.
is_mission_train() -> bool
property
writable
Gets or sets if the created train is a mission train.
is_train_engine() -> bool
property
writable
Gets or sets if the train is the engine of the train.
train_track_id() -> int
property
writable
Gets or sets the track id of the train.
train_engine_id() -> Vehicle | None
property
writable
Gets or sets the engine of the train.
train_config_index() -> int
property
writable
Gets or sets the trains config index.
Note
You can find a list of all possible config indices in the trains.xml. Valid indices are between 1 and 25.
train_distance_from_engine() -> float
property
writable
Gets or sets the distance of the trains to the engine.
is_train_caboose() -> bool
property
writable
Gets or sets if the train is a caboose.
train_direction() -> bool
property
writable
Gets or sets the direction of the train.
train_passenger_carriages() -> bool
property
writable
Gets or sets if the train is a passenger carriage.
train_render_derailed() -> bool
property
writable
Gets or sets if the trains is rendered derailed.
train_force_doors_open() -> bool
property
writable
Gets or sets if the doors of the trains should be forced open.
train_cruise_speed() -> float
property
writable
Gets or sets the cruise speed of the train.
train_carriage_config_index() -> int
property
writable
Gets or sets the config index of the train's carriage.
train_linked_to_backward_id() -> Vehicle | None
property
writable
Gets or sets another train that is linked to the back of the train. Returns null if there is no linked train.
train_linked_to_forward_id() -> Vehicle | None
property
writable
Gets or sets another train that is linked to the back of the train. Returns null if there is no linked train in front.
train_unk1() -> bool
property
writable
train_unk2() -> bool
property
writable
train_unk3() -> bool
property
writable
boat_anchor_active() -> bool
property
writable
Gets or sets the status of the boat anchor.
is_towing_disabled() -> bool
property
writable
rocket_refuel_speed() -> float
property
writable
bomb_count() -> int
property
writable
counter_measure_count() -> int
property
writable
script_max_speed() -> float
property
writable
weapons_disabled() -> bool
property
writable
hybrid_extra_active() -> bool
property
writable
hybrid_extra_state() -> bool
property
writable
damage_modifier() -> float
property
writable
damage_multiplier() -> float
property
writable
driver() -> Player | None
property
Gets the current driver of the vehicle. It returns null, if there is no driver.
Example
vehicle = alt.Vehicle("elegy", 0, 0, 0, 0, 0, 0)
driver = vehicle.driver
if driver:
alt.log(f"There is currently a player driving this car {driver.name}")
destroyed() -> bool
property
Gets if a vehicle is destroyed. Destroyed is set to True when specific game activities cause the engine to stop. Explosions, being underwater, crashing too much, etc.
Example
vehicle = alt.Vehicle("elegy", 0, 0, 0, 0, 0, 0)
if vehicle.destroyed:
alt.log("The elegy has been destroyed.")
modkits_count() -> int
property
Gets the maximum amount of vehicle mod kits available.
is_primary_color_rgb() -> bool
property
is_secondary_color_rgb() -> bool
property
is_tire_smoke_color_custom() -> bool
property
wheel_type() -> int
property
Gets the wheel type.
front_wheels() -> int
property
Gets the type of the front wheels.
rear_wheels() -> int
property
Gets the type of the rear wheels.
neon_active() -> bool
property
handbrake_active() -> bool
property
Gets if the handbrake of a car is active.
daylight_on() -> bool
property
Gets the current state of the daylights.
Example
vehicle = alt.Vehicle("elegy", 0, 0, 0, 0, 0, 0)
if vehicle.daylight_on:
alt.log("Vehicle daylights are on")
else:
alt.log("Vehicle daylights are off")
nightlight_on() -> bool
property
Gets the current state of the nightlights.
flamethrower_active() -> bool
property
Gets if a flamethrower of a vehicle is active on vehicle models like cerberus
.
wheels_count() -> int
property
Gets the amount of wheels of a vehicle.
repairs_count() -> int
property
Gets how often a vehicle got repaired.
has_armored_windows() -> bool
property
Gets if the car has armored windows.
velocity() -> Vector3
property
Gets the velocity vector of a vehicle.
attached() -> Vehicle | None
property
Gets a vehicle that is attached to the vehicle instance.
attached_to() -> Vehicle | None
property
Gets a vehicle where the vehicle is attached to.
has_timed_explosion() -> bool
property
timed_explosion_culprit() -> Player
property
timed_explosion_time() -> int
property
get_by_id(id: int) -> Vehicle | None
staticmethod
get_mod(mod_type: VehicleModType | int) -> int
Returns the mod value for a specific mod type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mod_type |
VehicleModType | int
|
The id of the mod type. |
required |
Returns:
Type | Description |
---|---|
int
|
The value of the mod type. |
set_mod(mod_type: VehicleModType | int, mod_id: int) -> bool
Applies a specific mod of a given mod type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mod_type |
VehicleModType | int
|
The type of the mod. |
required |
mod_id |
int
|
The id of the mod. |
required |
get_mods_count(mod_type: VehicleModType | int) -> int
Returns the amount of possible mod values for a specific mod type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mod_type |
VehicleModType | int
|
The id of the mod type. |
required |
Returns:
Type | Description |
---|---|
int
|
The amount of possible mod values of a mod type. |
get_extra(extra_id: int) -> bool
set_extra(extra_id: int, state: bool) -> None
Sets the state of an extra of a vehicle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
extra_id |
int
|
The id of the extra. |
required |
state |
bool
|
The state of the extra. |
required |
Note
Setting extras on vehicle does not work for every vehicle model. For example, you can change the light bar of a police car with this method.
get_door_state(door_id: int) -> VehicleDoorState
Returns the state of a specific door.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
door_id |
int
|
The id of the door. |
required |
Returns:
Type | Description |
---|---|
VehicleDoorState
|
The state of the door. |
set_door_state(door_id: int, state: VehicleDoorState | int) -> None
Sets the state of a specific door
Parameters:
Name | Type | Description | Default |
---|---|---|---|
door_id |
int
|
The id of the door. |
required |
state |
VehicleDoorState | int
|
The state of the door. |
required |
is_window_opened(window_id: int) -> bool
set_window_opened(window_id: int, state: bool) -> None
is_wheel_burst(wheel_id: int) -> bool
does_wheel_has_tire(wheel_id: int) -> bool
is_wheel_detached(wheel_id: int) -> bool
is_wheel_on_fire(wheel_id: int) -> bool
get_wheel_health(wheel_id: int) -> float
get_part_damage_level(part_id: VehiclePart | int) -> VehiclePartDamage
Returns the damage level of a vehicle part.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
part_id |
VehiclePart | int
|
The id of a vehicle part. |
required |
Returns:
Type | Description |
---|---|
VehiclePartDamage
|
The damage level of a vehicle part. |
get_part_bullet_holes(part_id: VehiclePart | int) -> int
Returns the amount of bullet holes of a vehicle part.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
part_id |
VehiclePart | int
|
The id of a vehicle part. |
required |
Returns:
Type | Description |
---|---|
int
|
The amount of bullet holes of a vehicle part. |
is_light_damaged(light_id: int) -> bool
is_window_damaged(window_id: int) -> bool
is_special_light_damaged(special_light_id: int) -> bool
get_armored_window_health(window_id: int) -> float
get_armored_window_shoot_count(window_id: int) -> int
get_bumper_damage_level(bumper_id: VehicleBumper | int) -> VehicleBumperDamage
Returns the damage level of a specific bumper.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bumper_id |
VehicleBumper | int
|
The id of a bumper. |
required |
Returns:
Type | Description |
---|---|
VehicleBumperDamage
|
The damage level of a bumper. |
repair() -> None
Repairs the vehicle.
set_wheels(wheel_type: int, wheel_id: int) -> None
set_rear_wheels(wheel_id: int) -> None
Sets type of the rear wheels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wheel_id |
int
|
The id of the rear wheel type. |
required |
set_wheel_burst(wheel_id: int, state: bool) -> None
set_wheel_has_tire(wheel_id: int, state: bool) -> None
set_wheel_health(wheel_id: int, health: int) -> None
set_wheel_detached(wheel_id: int, state: bool) -> None
set_wheel_on_fire(wheel_id: int, state: bool) -> None
set_wheel_fixed(wheel_id: int) -> None
Repairs a specific wheel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wheel_id |
int
|
The id of the wheel. |
required |
set_part_damage_level(part_id: VehiclePart | int, damage: VehiclePartDamage | int) -> None
Sets the damage level of a vehicle part.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
part_id |
VehiclePart | int
|
The id of the part. |
required |
damage |
VehiclePartDamage | int
|
The damage level. |
required |
set_part_bullet_holes(part_id: VehiclePart | int, count: int) -> None
Applies bullet holes to a specific vehicle part.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
part_id |
VehiclePart | int
|
The id of the part. |
required |
count |
int
|
The amount of bullet holes. |
required |
set_light_damaged(light_id: int, is_damaged: bool) -> None
set_window_damaged(window_id: int, is_damaged: bool) -> None
set_special_light_damaged(special_light_id: int, is_damaged: bool) -> None
set_armored_window_health(window_id: int, health: float) -> None
set_armored_window_shoot_count(window_id: int, count: int) -> None
set_bumper_damage_level(bumper_id: VehicleBumper | int, level: VehicleBumperDamage | int) -> None
Sets the damage level of a specific bumper.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bumper_id |
VehicleBumper | int
|
The id of the bumper. |
required |
level |
VehicleBumperDamage | int
|
The damage level. |
required |
set_search_light_to(entity: Entity, state: bool) -> None
Activates the searchlight and follows the target.
Note
Entity parameter isn't working for now and this can only be used for helicopter searchlights.
set_timed_explosion(state: bool, culprit: Player, time: int) -> None
get_weapon_capacity(weapon_index: int) -> int
set_weapon_capacity(weapon_index: int, capacity: int) -> None
VoiceChannel(spatial: bool, max_distance: float) -> None
Bases: BaseObject
Creates a new voice channel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spatial |
bool
|
Whether the voice channel should be 3D (e.g. talking in person) or 1D (e.g. talking over a telephone). |
required |
max_distance |
float
|
The max distance at which you can hear each other. |
required |
Note
This throws an error when the voice chat is not activated on serverside.
player_count() -> int
property
players() -> List[Player]
property
max_distance() -> float
property
spatial() -> bool
property
add_player(player: Player) -> None
has_player(player: Player) -> bool
is_player_muted(player: Player) -> bool
mute_player(player: Player) -> None
remove_player(player: Player) -> None
unmute_player(player: Player) -> None
Blip
Bases: WorldObject
all: Sequence[Blip]
class-attribute
List with all blips.
Note
This creates a clone of the list everytime it is called. It is advised to call this once and store the result in a variable, before iterating over it.
Example
blips = alt.Blip.all
for blip in blips:
alt.log(blip.name)
alpha() -> int
property
writable
as_mission_creator() -> bool
property
writable
attached_to() -> Entity
property
writable
bright() -> bool
property
writable
category() -> int
property
writable
color() -> BlipColor
property
writable
crew_indicator_visible() -> bool
property
writable
display() -> int
property
writable
flash_interval() -> int
property
writable
flash_timer() -> int
property
writable
flashes() -> bool
property
writable
flashes_alternate() -> bool
property
writable
friend_indicator_visible() -> bool
property
writable
gxt_name() -> str
property
writable
heading() -> float
property
writable
heading_indicator_visible() -> bool
property
writable
high_detail() -> bool
property
writable
name() -> str
property
writable
number() -> int
property
writable
outline_indicator_visible() -> bool
property
writable
priority() -> int
property
writable
pulse() -> bool
property
writable
route() -> bool
property
writable
route_color() -> RGBA
property
writable
scale() -> float
property
writable
secondary_color() -> RGBA
property
writable
short_range() -> bool
property
writable
show_cone() -> bool
property
writable
shrinked() -> bool
property
writable
size() -> Vector2
property
writable
Note
Doesn't properly work for areablips currently.
sprite() -> BlipSprite
property
writable
tick_visible() -> bool
property
writable
fade(opacity: int, duration: int) -> None
ColShape
Bases: WorldObject
polygon(min_z: float, max_z: float, points: List[Vector2]) -> ColShape
staticmethod
colshape_type() -> ColShapeType
property
players_only() -> bool
property
writable
Whether this colshape should only trigger its enter/leave events for players or all entities.
is_entity_in(entity: Entity | int) -> bool
is_point_in(pos: Vector3) -> bool
Checkpoint
Bases: ColShape
checkpoint_type() -> CheckpointType
property
height() -> float
property
radius() -> float
property
color() -> RGBA
property
ConnectionInfo
name() -> str
property
social_id() -> int
property
hwid_hash() -> int
property
hwid_ex_hash() -> int
property
auth_token() -> str
property
is_debug() -> bool
property
branch() -> str
property
build() -> int
property
cdn_url() -> str
property
password_hash() -> int
property
ip() -> str
property
discord_user_id() -> str
property
accepted() -> bool
property
accept() -> None
Note
This method works only when accessed from ConnectionQueue.
decline(reason: str) -> None
Note
This method works only when accessed from ConnectionQueue.
Resource
all: Sequence[Resource]
class-attribute
current: Resource
class-attribute
is_started() -> bool
property
type() -> str
property
name() -> str
property
main() -> str
property
path() -> str
property
config() -> Dict[Any, Any]
property
exports() -> Dict[str, Any]
property
dependencies() -> List[str]
property
dependants() -> List[str]
property
required_permissions() -> List[int]
property
optional_permissions() -> List[int]
property
get_by_name(resource_name: str) -> Resource
staticmethod
VehicleModelInfo
title() -> str
property
wheels_count() -> int
property
has_armored_windows() -> bool
property
primary_color() -> int
property
secondary_color() -> int
property
pearl_color() -> int
property
wheels_color() -> int
property
interior_color() -> int
property
dashboard_color() -> int
property
has_auto_attach_trailer() -> bool
property
type() -> VehicleType
property
available_modkits() -> List[bool]
property
has_extra(extra_id: int) -> bool
has_default_extra(extra_id: int) -> bool
BoneInfo
Bases: TypedDict
id: int
class-attribute
index: int
class-attribute
name: str
class-attribute
PedModelInfo
Bases: TypedDict
hash: int
class-attribute
name: str
class-attribute
pedBones: List[BoneInfo]
class-attribute
hash(value: str) -> int
Creates a hash using Jenkins one-at-a-time algorithm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
str
|
A string from which hash will be created. |
required |
get_net_time() -> int
Gets the amount of milliseconds since the server was started.
get_server_config() -> Dict[str, Any]
get_vehicle_model_info_by_hash(vehicle_hash: int) -> VehicleModelInfo
get_ped_model_info_by_hash(ped_hash: int) -> PedModelInfo
hash_server_password(password: str) -> int
Hash string with alt:V algortihm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
password |
str
|
The string you want to hash |
required |
set_password(password: str) -> None
Change the server password at runtime.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
password |
str
|
The new password. |
required |
stop_server() -> None
string_to_sha256(value: str) -> str
export(name: str, object: Any) -> None
restart_resource(resource_name: str) -> None
Restarts the specified resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_name |
str
|
Name of the resource. |
required |
start_resource(resource_name: str) -> None
Starts the specified resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_name |
str
|
Name of the resource. |
required |
stop_resource(resource_name: str) -> None
Stops the specified resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource_name |
str
|
Name of the resource. |
required |
delete_meta(key: str) -> None
Removes the specified key and the data connected to that specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the value to remove. |
required |
get_meta(key: str) -> Any
set_meta(key: str, value: Any) -> None
has_meta(key: str) -> bool
get_synced_meta(key: str) -> Any
has_synced_meta(key: str) -> bool
set_synced_meta(key: str, value: Any) -> None
delete_synced_meta(key: str) -> None
Removes the specified key and the data connected to that specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the value to remove. |
required |
timer(func: Callable[[], None], milliseconds: float) -> int
Schedules execution of handler once after the expiration of interval.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func |
Callable[[], None]
|
Function that should be scheduled for execution. |
required |
milliseconds |
float
|
The time, in milliseconds, before execution of specified function. |
required |
Returns:
Type | Description |
---|---|
int
|
A number representing the id value of the timer that is set. Use this value with the clear_timer function to cancel the timer. |
clear_timer(timer_id: int) -> None
log(*args: Any, sep: str = ' ') -> None
log_error(*args: Any, sep: str = ' ') -> None
log_warning(*args: Any, sep: str = ' ') -> None
emit(event_name: str, *args: Any) -> None
emit_client(player: Player | List[Player], event_name: str, *args: Any) -> None
emit_all_clients(event_name: str, *args: Any) -> None
set_world_profiler(state: bool) -> None
script_event(event: Event) -> Callable[[Any], None]
A decorator that subscribes to a server event with a listener
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
Event
|
The subscribed event. |
required |
server_event(event: str) -> Callable[[Any], None]
A decorator that subscribes to a custom event with a listener
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
str
|
Name of the event. |
required |
client_event(event: str) -> Callable[[Any], None]
A decorator that subscribes to a client event with a listener
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
str
|
Name of the event. |
required |