Simply install to your project:
sampctl package install xunder-matth/samp-altchat@v2
Include in your code and begin using the library:
#include <altchat>
- 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 value: 10
- Info: This is default alt. chat lines created if you don't pass
lines
argument toCreatePlayerAltChat
. Why 10? It's optimal for most displays (including 900p and 1080p).
- Default value: Not defined
- Info: You can add this before including
altchat
if you don't want to manually callCreatePlayerAltChat
. Keep in mind that this will callCreatePlayerAltChat
inOnPlayerConnect
and it will useDEFAULT_ALTCHAT_LINES
aslines
parameter.
- Parameters:
playerid
lines
- Returns:
- 1 - success
- 0 - fail
- Parameters:
playerid
- Returns:
- 1 - successfully destroyed
- 0 - fail
- Parameters:
playerid
bool:toggle
- Returns:
- true - successfully toggled
- false - fail (probably not created)
- Parameters:
playerid
const message[]
- Returns:
- 1 - successfully sended message to player
- 0 - fail (alt-chat not created or not shown for player)
- Parameters:
playerid
- Returns:
- 1 - if alt. chat is created
- 0 - if alt. chat is not created
- Parameters:
playerid
- Returns:
- 1 - if alt. chat is shown
- 0 - if alt. chat is not shown
- If you include
y_hooks
beforealtchat
include it will usey_hooks
hooking method - If you include
y_va
beforealtchat
include you can useva_SendPlayerAltChatMessage
to automatically format your messages CreatePlayerAltChat
will not fail if you reach Player TextDraw limit, it will warn you in server console
To test, simply run the package:
sampctl package run
Connect to server and test with commands
/state /create /destroy /show /hide /sendmsg