CreateVehicle

From Multi Theft Auto: Wiki
Revision as of 20:50, 23 March 2006 by 80.202.62.152 (talk)
Jump to navigation Jump to search

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

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