OnPlayerText
From SA-MP Wiki
OnPlayerText
Called when a player sends a chat message.
(playerid, text)
| playerid | The ID of the player who typed the text. |
| text[] | The text the player typed. |
| Returns | Returning 0 in this callback will stop the text from being sent |
public OnPlayerText(playerid, text[]) { // for example, if the variable mute[playerid] is set to 1, it will // stop the text from processing, otherwise it allows it to be sent. if(mute[playerid] == 1) return 0; return 1; }
Related Callbacks
The following callbacks might be useful as well, as they're related to this callback in one way or another.
- OnPlayerCommandText: Called when a player types a command.
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- SendPlayerMessageToPlayer: Force a player to send text for one player.
- SendPlayerMessageToAll: Force a player to send text for all players.
