Events
This page documents the network events, triggers, and state synchronization mechanisms utilized in AK47 Vehicle Keys (ak47_vehiclekeys).
Client Events
ak47_vehiclekeys:policeAlert
Receives vehicle theft/hotwire/lockpick alerts sent by the server for on-duty law enforcement officers when using the default built-in alert system.
RegisterNetEvent('ak47_vehiclekeys:policeAlert', function(coords, street, title, vehName, plate)
-- Displays notification and creates a temporary map blip radius for police/sheriff
end)ak47_vehiclekeys:getkey
Triggered by server command /getkey to generate and award a physical vehicle key to the admin.
ak47_vehiclekeys:getvkey
Triggered by server command /getvkey to generate and award a virtual vehicle key to the admin.
Server Events
ak47_vehiclekeys:setstate
Updates an entity state bag on a networked vehicle (e.g. doorslocked, hotwired).
TriggerServerEvent('ak47_vehiclekeys:setstate', vehNetId, stateName, stateValue)vehNetId(number): Network ID of the vehicle entity (VehToNet(vehicle)).stateName(string): The state name key (e.g.'doorslocked','hotwired').stateValue(any): The value to assign (true,false, etc.).
ak47_vehiclekeys:transferkey
Transfers a virtual vehicle key from the invoking player to a target player ID.
plate(string): Vehicle license plate.targetServerId(number): Destination player server ID.
ak47_vehiclekeys:policeAlert
Dispatches a default built-in police notification to all online police and sheriff players.
Entity State Bags
Vehicles managed by ak47_vehiclekeys use FiveM Entity State Bags for synchronized state management:
Entity(vehicle).state.doorslocked(boolean):true: Vehicle is locked.false: Vehicle is unlocked.
Entity(vehicle).state.hotwired(boolean):true: Vehicle has been successfully hotwired.
Last updated