OnVehicleStreamIn
From SA-MP Wiki
OnVehicleStreamIn
Warning: This is a new callback working since SA-MP 0.3. It won't work in previous versions.
Important note: For the NPC version of this callback, check NPC:OnVehicleStreamIn.
This callback is called when a vehicle is streamed in some player's client. A simpler definition would be when you see the grey vehicle icon appear on your map (from it not being on your map), it means you have got close enough to the vehicle for San Andreas to load ("stream") it. It then will call OnVehicleStreamIn.
(vehicleid, forplayerid)
| vehicleid | The vehicle that has been streamed. |
| forplayerid | The player who has streamed the vehicle. |
This function does not return a specific value, it's best to simply ignore it.
Important note: SetVehicleParamsForPlayer has to be reapplied each time a vehicle streams in someone's client.
// Will show vehicle markers for players streaming in for 0.3 new iVehicleObjective[MAX_VEHICLES][2]; stock SetVehicleParamsForPlayerEx(vehicleid, playerid, objective, doorslocked) { SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked); iVehicleObjective[vehicleid][0] = objective; iVehicleObjective[vehicleid][1] = doorslocked; } public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); }
Related Callbacks
The following callbacks might be useful as well, as they're related to this callback in one way or another.
- OnPlayerStreamIn: Called when a player streams in another player.
- OnPlayerStreamOut: Called when a player streams out from other player.
- OnVehicleStreamOut: Called when a player streams out a vehicle.
