[PAID] [QB/QBX/ESX] Playable Police Dog

Player controlled police dogs! Qb/Qbox/ESX support built-in, but there are only one or two functions that rely on the framework, so it should be easy for anyone to quickly extend the script for their own framework. Framework and interface files are unlocked, to be able to change commands and customize database interactions. However the rest are escrowed. Locale support built-in for escrowed files.

Features

Persistent Dog Character

  • Admin commands /setPoliceDog [id] [variation] and /removePoliceDog [id] to set characters to be dogs.
  • This data is stored in a database and persisted so that everytime the character loads in they will load in as a dog with full health.
  • The model bundled with mana_policedogs includes a few variations to have different looking dogs.

Scent

  • Players drop scent as they move around the world, which can be seen by dogs when they have their nose toggled on via bound key.
  • Scent is colored individually for each player, and decays over time, fading away.
  • If a player hasn’t moved far enough away from their last dropped scent, rather than drop new scent, their existing scent will have its decay reset.
  • Dogs only see scent within a configurable range around them.
  • Dogs do not see their own scent.
  • The visual indicated for scent and its size are configurable.
  • Scent is not dropped while a player is in a vehicle.
  • Dog is notified when nose is toggled on/off

Cert System

Define capabilities of each dog on a player by player basis. The ‘tracking’ cert is required for a dog to use the scent feature for example.

  • Can specify default certs each dog starts with
  • Can add/remove certs with /addCert [id] [cert] & /removeCert [id] [cert]
  • Can view certs with /certs [id]
  • New exports to add/remove certs

Contraband Searching

Dogs with the appropriate cert can press a button to sniff the closest player for contraband, notifying the dog if the individual possesses contraband in amounts high enough for the dog to detect

  • Can define multiple contraband lists with different certs required to detect different types of contraband
  • Can define minimum amount of an item required to trigger a detection
  • Added animation to show that a dog is searching someone
Code is accessible Partially
Subscription-based No
Lines (approximately) 650
Requirements ox_lib
Support Yes
3 Likes

So what does your script offer, aside from the free asset you are using from:

1 Like

The two features currently are persistent dog character and scent.

hey i am trying to change the dict and textures for the scent to be little circles like what you have in your screenshot but no matter what i change it to its always big squares. am i doing something incorrectly?

The default config should already be little circles. If you make the sprite too big I think it turns into large squares. I used 0.01 for default size, but try making it smaller than that and seeing if it turns into circles.

Great little resource, looking forward to the update where LSPD can choose to transform in/out of the ped. Good work as usual Manason.

v2 Released

Cert System

Define capabilities of each dog on a player by player basis. The ‘tracking’ cert is required for a dog to use the scent feature for example.

  • Can specify default certs each dog starts with
  • Can add/remove certs with /addCert [id] [cert] & /removeCert [id] [cert]
  • Can view certs with /certs [id]
  • New exports to add/remove certs

Contraband Searching

Dogs with the appropriate cert can press a button to sniff the closest player for contraband, notifying the dog if the individual possesses contraband in amounts high enough for the dog to detect

  • Can define multiple contraband lists with different certs required to detect different types of contraband
  • Can define minimum amount of an item required to trigger a detection
  • Added animation to show that a dog is searching someone

Other Changes

  • Support for multiple dog models through a DogType system. Can define a custom onTransform function, which is executed when transforming a player to the DogType.
  • Added more error/sucess messages when running commands for greater feedback/confirmation on the result
  • Registering/Unregistering immediately grants/revokes abilities
  • Re-did parts of the config to accomodate new features and simplify
  • Re-organized some files to make things easier to find
  • Removed model allow lists as cert system should be used instead
  • Exposed new client exports ToggleScent & IsInScentMode
  • Exposed new server exports RegisterDog, UnregisterDog, SetPlayerScentIcon
2 Likes