Beispiel #1
0
        public static void serverCmddismountVehicle(GameConnection client)
        {
            Player  player    = client["player"];
            Vehicle car       = player.getControlObject();
            Player  passenger = car.getMountNodeObject(0);

            ((PlayerData)passenger.getDataBlock()).doDismount(passenger);
            client.setControlObject(player);
        }
Beispiel #2
0
 public virtual int findEmptySeat(Vehicle vehicle, Player player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
     {
         int node = vehicle.getMountNodeObject(i);
         if (node != 0)
         {
             return(i);
         }
     }
     return(-1);
 }
Beispiel #3
0
        public bool isPilot()
        {
            Vehicle vehicle = getObjectMount();

            if (vehicle.isObject())
            {
                if (vehicle.getMountNodeObject(0) == this)
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #4
0
 public virtual int switchSeats(Vehicle vehicle, Player player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
     {
         int node = vehicle.getMountNodeObject(i);
         if (node == player || node > 0)
         {
             continue;
         }
         if (node == 0)
         {
             return(i);
         }
     }
     return(-1);
 }
Beispiel #5
0
 public virtual int switchSeats(Vehicle vehicle, Player player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
         {
         int node = vehicle.getMountNodeObject(i);
         if (node == player || node > 0)
             continue;
         if (node == 0)
             return i;
         }
     return -1;
 }
Beispiel #6
0
 public virtual int findEmptySeat(Vehicle vehicle, Player player)
 {
     for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
         {
         int node = vehicle.getMountNodeObject(i);
         if (node != 0)
             return i;
         }
     return -1;
 }