Aller au contenu principal

ShowHelpNotification

La fonction ShowHelpNotification permet d'afficher une notification clignotante (pulsante) à l'utilisateur. Elle est souvent utilisée pour fournir des informations ou des rappels sans interruption.

Fonction ShowHelpNotification

La syntaxe pour afficher une notification est la suivante :

zUI.ShowHelpNotification(content, styles)

Paramètres

  • content [string] : Le contenu de la notification (texte à afficher).
  • styles [table] : Un tableau contenant les styles pour personnaliser l'apparence de la notification. Exemple : { Color: "#ff0000" }.

Exemple d'utilisation

Voici un exemple d'utilisation de la fonction ShowHelpNotification :

Citizen.CreateThread(function()
while true do
Wait(0)
if #(coords - GetEntityCoords(PlayerPedId())) < 3 then
zUI.ShowHelpNotification("Appuyez sur ~INPUT_CONTEXT~ pour intéragir", { Color = "#00ff00" })
end
end
end)

Aperçu de l'exemple

Résumé

Pour utiliser la fonction ShowHelpNotification :

  1. Appelez la fonction zUI.ShowHelpNotification pour afficher la notification pulsante.
  2. Spécifiez le contenu à afficher et les styles (par exemple, la couleur).
  3. La notification sera affichée à l'utilisateur jusqu'à ce qu'elle disparaisse.