OnNPCEnterVehicle: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome| desc=Gets called when an NPC enters a vehicle. Or in other words, the server has put the NPC in a vehicle.| params=<syntaxhighlight lang="lua">(vehicleid, seatid)</...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
function OnNPCEnterVehicle(vehicleid, seatid)  
function OnNPCEnterVehicle(vehicleid, seatid)  
{  
{  
    SendChat("Do anybody want a ride?");
    if(!seatid)
      SendChat("Do anybody want a ride?");
}  
}  
</source>
</source>|relfuncs=
*[[EnterVehicle]]
}}
}}

Latest revision as of 14:10, 14 February 2023


Description:
Gets called when an NPC enters a vehicle. Or in other words, the server has put the NPC in a vehicle.


Parameters:

(vehicleid, seatid)

vehicleid : The ID of the vehicle in which NPC is entering.
seatid : The seat of the vehicle which the NPC occupies.


Return Values:
This function does not return any specific values.


Example

function OnNPCEnterVehicle(vehicleid, seatid) 
{ 
    if(!seatid)
       SendChat("Do anybody want a ride?");
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.