Skip to main content

FivePD API v1.3

ยท 2 min read
FivePD
Development Team @ FivePD

The new v1.3 API update brings a few new, requested features. The updated API binary is only compatible with the main FivePD v1.5+ build. Old callouts/plugins are still compatible and will not be affected in any way by this update.

After this update, we'll be working in the dev branch of the API repository before merging the changes into the master branch. This will help us to properly develop new features, and you will be able to see the upcoming API changes, which might affect your custom plugins/callouts (if you are a developer).

New features#

Utilities.GetPassengersFromTrafficStop#

  • Returns an array of passenger peds from the pulled over vehicle (driver ped will not be added into the array).

Usage:

var passengers = Utilities.GetPassengersFromTrafficStop();

See GetPassengersFromTrafficStop

Utilities.GetDriverFromTrafficStop#

  • Returns the driver ped from of pulled over vehicle.

Usage:

var driver = Utilities.GetDriverFromTrafficStop();

See GetDriverFromTrafficStop

Utilities.SetPlayerDataFlags#

  • An enum that contains every possible option that you can use to set player data.
  • Use -1 as the department id if you want to kick a player from the player's current department
public enum SetPlayerDataFlags{    DepartmentID = 1,    Callsign = 2,    All = DepartmentID | Callsign}

See SetPlayerData

SetPlayerData (persistent)#

  • Changing the player's data will be saved in the database.

Usage:

var playerData = new PlayerData();playerData.DepartmentID = -1;
// This will kick the player from the department (only changes the department id)Utilities.SetPlayerData(playerData, SetPlayerDataFlags.DepartmentID);

See SetPlayerData