예제 #1
0
 public int VehicleDataFindEmptySeat(coVehicleData thisobj, coVehicle vehicle, coPlayer player)
     {
     for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
         {
         int node = vehicle.getMountNodeObject(i);
         if (node != 0)
             return i;
         }
     return -1;
     }
예제 #2
0
 public int VehicleDataSwitchSeats(coVehicleData thisobj, coVehicle vehicle, coPlayer player)
     {
     for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
         {
         int node = vehicle.getMountNodeObject(i);
         if (node == player || node > 0)
             continue;
         if (node == 0)
             return i;
         }
     return -1;
     }
예제 #3
0
 public void VehicleDataOnRemove(coVehicleData thisobj, coVehicle obj)
     {
     // if there are passengers/driver, kick them out
     for (int i = 0; i < ((coVehicleData) obj.getDataBlock())["numMountPoints"].AsInt(); i++)
         {
         coPlayer passenger = obj.getMountNodeObject(i);
         if (passenger != "0")
             passenger.call("doDismount", true.AsString());
         }
     }