CS_PANICBUTTON V2
A panicbutton script combining both user friendliness and realism for your server.
Last updated
Was this helpful?
A panicbutton script combining both user friendliness and realism for your server.
Last updated
Was this helpful?
Locale
: Sets the language for the Panic Button messages. Options are:
"EN"
for English
"DE"
for German
Framework
: Specifies the framework your server uses. Options are:
"ESX"
"QBCore"
"Custom"
The framework feature currently is only experimental. The only supported framework is ESX!
Each command defines a specific Panic Button functionality. Two commands are predefined:
localPanic
Sends a localized panic alert to nearby players.
Configuration options:
enabled
: Enables or disables this command.
commandName
: The name of the command (default is "localPanic"
).
defaultKey
: The default keyboard key to trigger this command (default is "U"
).
showUI
: If true
, displays a user interface when the button is pressed.
autoClose
: If true
, closes the UI automatically after activation.
allowedWhenDead
: If true
, allows the command even when the player is dead.
setWaypoint
: If true
, automatically sets a waypoint for responding units.
radius
: Defines the area of effect for the alert in meters. Set to false
for global.
timeUntilRemoval
: Time in seconds before the alert is removed.
soundEnabled
: Enables or disables the panic alert sound.
playSoundForNearbyPlayers
: If true
, plays a sound for nearby players.
playClickRadius
: The radius in which the sound is audible.
needItem
: If true
, requires the player to have a specific item to trigger the command.
itemName
: The required item's name (e.g., "panicbutton"
).
jobs
: Specifies which jobs can use this command and their minimum required grades (e.g., ["police"] = 5
).
PanicButtonNotification
: Defines how notifications appear for different panic types.
localPanic
: Shows a localized alert.
globalPanic
: Shows a global alert.
ShowUI(): Client function triggered when the UI is displayed.
HideUI(): Client function triggered when the UI is hidden.
NotificationFunction(title, msg, type): The notification function used.
Make sure to change the Notification function to your notify trigger!
Or else the script will not work properly.
Different types of notifications available:
NotifyTypes: Defines types like info
, error
, success
, warning
.
Translations for different languages:
LocalesPanicbutton: Contains translations for English (EN
) and German (DE
).
Determines whether an old or new version of ESX is being used and initializes the shared object accordingly. If you want to, you can of course change the shared object to fit your needs.
The script offers 2 webhooks.
globalPanic
localPanic
If you do not want a webhook to be sent, just leave the string empty. Like this:
In this example, you would not be notified when a player triggers a local panicbutton.
Activating Local Panic
Command: /localPanic
Keybind: U
Activating Global Panic
Command: /globalPanic
Keybind: I
Item Requirement
Ensure the player has the panicbutton
item in their inventory (if needItem
is enabled).
Job Restrictions
Verify that the player’s job and grade meet the requirements (e.g., police
, grade 5
).
If you have any further questions, open a ticket on our discord server: discord.gg/core-services