OnPlayerChat

From Multi Theft Auto: Wiki
Revision as of 15:47, 29 March 2006 by JonChappell (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered when a player chats inside the chat box.

Supplied Variables

player: The player who typed the text. message: The text that was typed.

Example

function onPlayerChat ( player, chat )
  if ( strtok ( chat, 1, 32 ) == "!createhydra" ) then
    x, y, z = getPlayerPosition ( player )
    createVehicle ( 520, x + 5, y, z )
    playerPM ( player, "You got a hydra" )
  end
end