CreateVehicle: Difference between revisions

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


==Syntax==
==Syntax==
  createVehicle ( model, x, y, z [, rx, ry, rz ] )
  vehicle createVehicle ( model, x, y, z [, rx, ry, rz ] )


==Example==
==Example==

Revision as of 20:50, 23 March 2006

Description

This function creates a vehicle and returns a handle to the created vehicle. If it fails, it will return false. This can happen if you exceed the upper vehicle limit at 65535 or due to an another unspecified future reason.

Syntax

vehicle createVehicle ( model, x, y, z [, rx, ry, rz ] )

Example

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