open.mp | OnPlayerText
  • Home
  • FAQ
  • Forum
  • Servers
  • Docs
  • Blog
  • Login
  • Englishاللغة العربيةar-TNবাংলাbosanski jezikDeutschΕλληνικάEspañoleestiفارسیFrançaisHrvatskimagyarBahasa IndonesiaItaliano日本語ქართულიlietuvių kalbaNederlandsNorskjęzyk polskiPortuguêsRomânăРусскийslovenski jezikсрпски језикไทยWikang TagalogTürkçeУкраїнськаاردوTiếng Việt简体中文繁體中文

OnPlayerText

คำอธิบาย

Called when a player sends a chat message.

NameDescription
playeridThe ID of the player who typed the text.
text[]The text the player typed.

ส่งคืน

It is always called first in filterscripts so returning 0 there blocks other scripts from seeing it.

ตัวอย่าง

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
}

บันทึก

tip

NPC สามารถเรียก Callback นี้ได้

ฟังก์ชั่นที่เกี่ยวข้องกัน

  • SendPlayerMessageToPlayer: Force a player to send text for one player.
  • SendPlayerMessageToAll: Force a player to send text for all players.

Community

  • Discord
  • Instagram
  • Twitter
  • Twitch
  • YouTube
  • Facebook
  • VK

More

  • SA-MP
  • Blog
  • GitHub