OnPlayerChat: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:Incomplete Event]]
__NOTOC__
__NOTOC__
This event is triggered when a player chats inside the chat box.
This event is triggered when a player chats inside the chat box.

Revision as of 15:29, 2 December 2006


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