GetVehicleSirenParams

From Multi Theft Auto: Wiki
Revision as of 16:40, 20 April 2012 by Jaysds (talk | contribs) (→‎Example)
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.4 r3966:

This function get the parameters of a vehicles siren.

Syntax

table getVehicleSirenParams ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle to get the siren parameters of

Returns

Returns a table with the siren count, siren type and a sub table for the four flags. False otherwise.

sirenParams = { sirenCount, sirenType, { is360, doLOSCheck, useRandomiser, silent } }

Example

Click to collapse [-]
Server
addEventHandler("onVehicleEnter",root,function(player,seat)
   if(player)and(seat==0)then
      vehicle = getPedOccupiedVehicle(player)
      addVehicleSirens(vehicle,1,1)
      setVehicleSirens(vehicle,1,0,0,0,100,0,100,255,122)
      bindKey(player,"g","up",getSiren,vehicle)
   end
end)
 
function getSiren(player,button,state,vehicle)
   local sirenParams = getVehicleSirenParams(vehicle)
   outputChatBox("Here's the parameters of your vehicle sirens: Siren Points: "..sirenData[0]..", Type of Siren: "..sirenData[1]..".",player)
end
 
addEventHandler("onVehicleExit",root,function(player,seat)
   if(player)and(seat==0)then
      vehicle = getPedOccupiedVehicle(player)
      removeVehicleSirens(vehicle)
      unbindKey(player,"g","up",getSiren)
   end
end)

Requirements

This template will be deleted.

See Also