Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: FarisDon on Feb 13, 2016, 10:27 AM

Title: Vehicle Confusion,,,,
Post by: FarisDon on Feb 13, 2016, 10:27 AM
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....
Title: Re: Vehicle Confusion,,,,
Post by: Xmair on Feb 13, 2016, 10:32 AM
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.
Title: Re: Vehicle Confusion,,,,
Post by: FarisDon on Feb 13, 2016, 10:40 AM
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.