OnPlayerChat: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
Line 3: Line 3:


==Supplied Variables==
==Supplied Variables==
'''[[player]]''': The player who typed the text.
'''[[player]]''': The player who typed the text.<br>
'''message''': The text that was typed.
'''message''': The text that was typed.



Revision as of 15:47, 29 March 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