Vehicle Confusion,,,,

Started by FarisDon, Feb 13, 2016, 10:27 AM

Previous topic - Next topic

FarisDon

function onSphereEntered(player, sphere)
{
local veh = player.Vehicle;
if ( sphere.ID == 0 && player.Vehicle && veh.GetOccupant( 1 || 2 || 3 ) )
{
 bla.Pos = bla;//here, I want to send the passenger who is slot 1,2, or 3.
}
}
Well, Actually I made this, and I want to take the passenger out from the car when it reach it's point, but i'm unable to make an correct algorithm, for this :| I know this is really kinda silly, but honestly, i'm totally confuse that how can i really take out the passenger? is their anyway, please just gave your ideas.
P.S: - Sorry, for my bad English....

Xmair

#1
Try this:
function onSphereEntered ( player , sphere )
{
local veh;
if ( player.Vehicle )  veh = player.Vehicle;
if ( sphere.ID == 0 && veh )
{
if ( veh.GetOccupant( 1 ) == player || veh.GetOccupant( 2 ) == player || veh.GetOccupant( 3 ) == player )
{
player.Eject();
blablabalbalhere.
}
}
}
Untested.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

FarisDon

Quote from: Xmair on Feb 13, 2016, 10:32 AMTry this:
function onSphereEntered ( player , sphere )
{
local veh;
if ( player.Vehicle )  veh = player.Vehicle;
if ( sphere.ID == 0 && veh )
{
if ( veh.GetOccupant( 1 ) == player || veh.GetOccupant( 2 ) == player || veh.GetOccupant( 3 ) == player )
{
player.Eject();
blablabalbalhere.
}
}
}
Untested.
Actually, I just solved it, by myself .-.
lol, sorry, for wasting your time. I've made a far more better algorithm than this.
Sorry anyway locked, but I was just gonna delete this topic, but meh you replied.