README

Visit our Discord / Homepage / Store !


Requirements / Dependencies

The following resources are required for nss_skunk to work:


Changelog

See CHANGELOG.md for more information.


Features

  • Use items to add scents to players that scare off animals from that player.

  • Configure...

    • radius, duration and affected animals of the scent.

    • if swimming washes off scents.

    • each scent individually if animals recognize the scent if it's raining.

    • if a beautiful animation is played when applying a scent.

  • Multiple scents can be applied at the same time.

  • If a scent runs out, the player will be notified.

  • Active effects are stored in the database and expiring in real-time (even if the player is offline).

  • If a scared animal gets damaged it no longer runs away.

  • Call this script from every other script to remove all effects from a player via a client event.

  • Full language support

    • EN and DE already included in config file

  • Never miss updates again: Automatic version check included.

  • Know how it works: Everything is documented in detail in the README.md and the config file.

  • Do it right: A configuration validator helps you find errors in your config file.

  • And more...


Open ToDo's

  • Player can place scents on the ground as stationary objects.

  • Other players can destroy scent objects on the ground.


Known issues

  • Currently, no known issues.


Setup script

  1. Ensure that the nss_skunk folder is in your resources folder.

  2. Rename config.demo.lua to config.lua and fill in the values.

  3. Add ensure nss_skunk to your server.cfg.

  4. Restart your server.

  5. Check if the database tables are created by the script to ensure all is fine.


Config.CustomClientEventNameToRemoveEffects

This property is optional, type is string, default value is nil.

Config.CustomClientEventNameToRemoveEffects defines an event name that is taken into account by nss_skunk on the client side. If, for example, another script fires an event, you can use it to listen for the event here and trigger all effects on the player to be removed. For example, if you have a script where the player gets into a bathtub and a client event is fired, you can listen to that client event name.

However, you can also simply define a client event name in nss_skunk and fire it in your other scripts if required.

Example on client side:

-- nss_skunk -> config.lua
Config.CustomClientEventNameToRemoveEffects = 'nss_skunk_remove_effects'

---------------------------------------------------------------------------------------------

-- your client script (with message)
local custom_notify_title = 'Bath time'
local custom_notify_message = 'You feel refreshed and clean.'
TriggerEvent('nss_skunk:removeEffects', custom_notify_title, custom_notify_message)

---------------------------------------------------------------------------------------------

-- your client script (without message)
TriggerEvent('nss_skunk:removeEffects')

If you do not give a title and message then the language keys default_clear_all_effects_title and default_clear_all_effects_message will be used.

Example on server side:

-- nss_skunk -> config.lua
Config.CustomClientEventNameToRemoveEffects = 'nss_skunk_remove_effects'

---------------------------------------------------------------------------------------------

-- your server script (with message)
local player = source -- or any other player
local custom_notify_title = 'Bath time'
local custom_notify_message = 'You feel refreshed and clean.'
TriggerClientEvent('nss_skunk_remove_effects', player, custom_notify_title, custom_notify_message)

---------------------------------------------------------------------------------------------

-- your server script (without message)
TriggerClientEvent('nss_skunk_remove_effects', player)

If you do not give a title and message then the language keys default_clear_all_effects_title and default_clear_all_effects_message will be used.


FAQ

Can rain wash off the scent?

Currently, not. We have not found a good way to detect if the player gets wet. If a player stands under a roof, the rain does not hit him, but we can not detect this currently. We can not detect if the player gets wet clothes.

Last updated