---
title: "OnPlayerText | open.mp"
description: "Pozvano kada igrač pošalje chat poruku."
canonical: https://omp.itsneufox.com/bs/docs/scripting/callbacks/OnPlayerText
language: bs
---

# OnPlayerText

## Deskripcija

Pozvano kada igrač pošalje chat poruku.

| Ime | Deskripcija |
| --- | --- |
| playerid | ID igrača koji je napisao tekst. |
| text\[\] | Tekst kojeg je igrač napisao. |

## Returns

Uvijek je pozvan prvo u filterskriptama tako da će return-ovanje 0 blokirati ostale skripte da ga vide.

## Primjeri

```c
public OnPlayerText(playerid, text[])
{
    new pText[144];
    format(pText, sizeof (pText), "(%d) %s", playerid, text);
    SendPlayerMessageToAll(playerid, pText);
    return 0; // ignore the default text and send the custom one
}
```

## Zabilješke

note

Ovaj callback pozvat će i NPC.

## Srodne Funkcije

-   [SendPlayerMessageToPlayer](https://omp.itsneufox.com/bs/docs/scripting/functions/SendPlayerMessageToPlayer): Forsira igrača da pošalje tekst drugom igraču.
-   [SendPlayerMessageToAll](https://omp.itsneufox.com/bs/docs/scripting/functions/SendPlayerMessageToAll): Forsira igrača da pošalje tekst svim igračima.
