OnVehicleStreamIn: Difference between revisions

From Onset Developer Wiki
Chloe (talk | contribs)
Added a description, example, and related functions tag.
No edit summary
 
Line 12: Line 12:
== Example ==
== Example ==
<syntaxhighlight lang="Lua>
<syntaxhighlight lang="Lua>
AddEvent("OnVehicleStreamOut", function(vehicle)
AddEvent("OnVehicleStreamIn", function(vehicle)
AddPlayerChat("Vehicle ID " .. vehicle .. " has now streamed for you! There's now " .. #GetStreamedVehicles() .. " vehicles streamed for you!")
AddPlayerChat("Vehicle ID " .. vehicle .. " is now streamed for you! There are " .. #GetStreamedVehicles() .. " vehicles streamed for you!")
end)
end)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 15:38, 2 August 2020

OnVehicleStreamIn

Type: Event
Context: Server & Client
Introduced: v1.0

Description

Calls when a vehicle streams out of the streaming distance set in your server_config for a player.

Syntax

OnVehicleStreamIn(vehicle, player)
Client Syntax
OnVehicleStreamIn(vehicle)

Parameters

  • vehicle
    The vehicle for the other player is streamed in.
  • player
    The player that streams in for vehicle.

Example

AddEvent("OnVehicleStreamIn", function(vehicle)
	AddPlayerChat("Vehicle ID " .. vehicle .. " is now streamed for you! There are " .. #GetStreamedVehicles() .. " vehicles streamed for you!")
end)

See also