samp.directory
← Scripts et bibliothèques

xunder-matth/samp-altchat

Alternative chat for SA-MP (textdraw)

Bibliothèque★ 9mis à jour mai 2024Pas de licencePawnsampctl
Ouvrir sur GitHub

Ce dépôt n’a pas de fichier de licence. Il est public en lecture, mais cela ne donne pas à lui seul le droit de le réutiliser.

Installer avec sampctl

sampctl package install xunder-matth/samp-altchat

Lance ceci dans le dossier de ton projet. sampctl télécharge le paquet et ce dont il dépend.

L’essayer dans le compilateur Pawn →

Ajoute ses fichiers include, avec les bibliothèques dont il dépend, au compilateur Pawn de ton navigateur, prêts à être inclus dans un script.

Dépend de 1 paquet

Utilisé par 1 paquet

README.md

samp-altchat

Installation

Simply install to your project:

sampctl package install xunder-matth/samp-altchat@v2

Include in your code and begin using the library:

#include <altchat>

Configuration

MAX_ALTCHAT_LINES
  • Default value: 15
  • Info: 15 should be fine on 1080p displays. However if you want you can crank it up if you need more max lines (1440p, 4k etc.)
DEFAULT_ALTCHAT_LINES
  • Default value: 10
  • Info: This is default alt. chat lines created if you don't pass lines argument to CreatePlayerAltChat. Why 10? It's optimal for most displays (including 900p and 1080p).
ALTCHAT_AUTO_CREATE
  • Default value: Not defined
  • Info: You can add this before including altchat if you don't want to manually call CreatePlayerAltChat. Keep in mind that this will call CreatePlayerAltChat in OnPlayerConnect and it will use DEFAULT_ALTCHAT_LINES as lines parameter.

API

CreatePlayerAltChat
  • Parameters:
    • playerid
    • lines
  • Returns:
      • 1 - success
      • 0 - fail

DestroyPlayerAltChat
  • Parameters:
    • playerid
  • Returns:
      • 1 - successfully destroyed
      • 0 - fail

TogglePlayerAltChat
  • Parameters:
    • playerid
    • bool:toggle
  • Returns:
      • true - successfully toggled
      • false - fail (probably not created)

SendPlayerAltChatMessage
  • Parameters:
    • playerid
    • const message[]
  • Returns:
      • 1 - successfully sended message to player
      • 0 - fail (alt-chat not created or not shown for player)

IsPlayerAltChatCreated
  • Parameters:
    • playerid
  • Returns:
      • 1 - if alt. chat is created
      • 0 - if alt. chat is not created

IsPlayerAltChatShown
  • Parameters:
    • playerid
  • Returns:
      • 1 - if alt. chat is shown
      • 0 - if alt. chat is not shown

Notes

  • If you include y_hooks before altchat include it will use y_hooks hooking method
  • If you include y_va before altchat include you can use va_SendPlayerAltChatMessage to automatically format your messages
  • CreatePlayerAltChat will not fail if you reach Player TextDraw limit, it will warn you in server console

Testing

To test, simply run the package:

sampctl package run

Connect to server and test with commands

/state /create /destroy /show /hide /sendmsg

Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche

xunder-matth/samp-altchat : Bibliothèque SA-MP | samp.directory