示例#1
0
        public RPVehicle(int id, int ownerId, FactionEnums factionID, VehicleHash model, float parkx, float parky, float parkz, float parkrotationx, float parkrotationy, float parkrotationz, int color1, int color2, String licensePlateText = "", Boolean spawn = true)
        {
            this.id                = id;
            this.ownerId           = ownerId;
            this.factionID         = factionID;
            this.model             = model;
            this.parkPosition      = new Vector3(parkx, parky, parkz);
            this.parkRotation      = new Vector3(parkrotationx, parkrotationy, parkrotationz);
            this.licensePlateText  = licensePlateText;
            this.licensePlateStyle = 0;
            this.color1            = color1;
            this.color2            = color2;
            this.handle            = null;

            if (spawn && ownerId < 0)
            {
                this.Spawn();
                this.ToggleDoorLock();
            }

            if (!licensePlateText.Equals("") && this.spawned)
            {
                this.handle.numberPlate = licensePlateText;
            }

            VehicleManager.Instance().SubscribeToVehicleDestroyedEvent(this.VehicleDestroyedEvent);
        }
示例#2
0
 public Faction(FactionEnums id, String name, int colorR, int colorG, int colorB)
 {
     this.id     = id;
     this.name   = name;
     this.colorR = colorR;
     this.colorG = colorG;
     this.colorB = colorB;
 }
示例#3
0
 protected bool IsCharacterValid(Character character, FactionEnums faction)
 {
     if (character != null && character.factionID == faction)
     {
         return(true);
     }
     return(false);
 }
示例#4
0
 public Character(Player owner, int ID, String firstName, String lastName, FactionEnums factionID, string model, int money, int job, String phoneNumber, int spawnHouseId)
 {
     this.owner        = owner;
     this.model        = model;
     this.onDuty       = false;
     this.factionID    = factionID;
     this.ID           = ID;
     this.firstName    = firstName;
     this.lastName     = lastName;
     this.money        = money;
     this.job          = job;
     this.gender       = PlayerManager.Instance().GetGenderForModel(model);
     this.phone        = new Phone(this, phoneNumber);
     this.spawnHouseId = spawnHouseId;
     this.inventory    = new Inventory(this);
     this.equippedItem = null;
 }
示例#5
0
 /// <summary>
 /// Creates a new vehicle into the database
 /// Used for debugging purposes only!
 /// </summary>
 /// <param name="ownerId">Id of the owning character</param>
 /// <param name="faction">Id of the faction if exists, 0 if civilian</param>
 /// <param name="model">Vehicle model</param>
 /// <param name="parkX">Vehicle park X position</param>
 /// <param name="parkY">Vehicle park Y position</param>
 /// <param name="parkZ">Vehicle park Z position</param>
 /// <param name="parkRotX">Vehicle park X rotation</param>
 /// <param name="parkRotY">Vehicle park Y rotation</param>
 /// <param name="parkRotZ">Vehicle park Z rotation</param>
 /// <param name="plateText">Text of the license plate</param>
 /// <param name="plateStyle">Style of the license plate</param>
 /// <param name="color1">Primary color of the vehicle</param>
 /// <param name="color2">Secondary color of the vehicle</param>
 /// <returns></returns>
 public int AddVehicleToDatabase(int ownerId, FactionEnums faction, string model, float parkX, float parkY, float parkZ, float parkRotX, float parkRotY, float parkRotZ, string plateText, int plateStyle, int color1, int color2)
 {
     var cmd = DBManager.SimpleQuery("INSERT INTO vehicles VALUES (@id, @ownerId, @faction, @model, @park_x, @park_y, @park_z, @park_rot_x, @park_rot_y, @park_rot_z, @platetxt, @style, @color1, @color2)");
     cmd.Parameters.AddWithValue("@id", this.vehicleInsertId);
     cmd.Parameters.AddWithValue("@ownerId", ownerId);
     cmd.Parameters.AddWithValue("@faction", (int)faction);
     cmd.Parameters.AddWithValue("@model", API.shared.vehicleNameToModel(model));
     cmd.Parameters.AddWithValue("@park_x", parkX);
     cmd.Parameters.AddWithValue("@park_y", parkY);
     cmd.Parameters.AddWithValue("@park_z", parkZ);
     cmd.Parameters.AddWithValue("@park_rot_x", parkRotX);
     cmd.Parameters.AddWithValue("@park_rot_y", parkRotY);
     cmd.Parameters.AddWithValue("@park_rot_z", parkRotZ);
     cmd.Parameters.AddWithValue("@platetxt", plateText);
     cmd.Parameters.AddWithValue("@style", 0);
     cmd.Parameters.AddWithValue("@color1", color1);
     cmd.Parameters.AddWithValue("@color2", color2);
     cmd.ExecuteNonQuery();
     this.AddVehicleToManager(this.vehicleInsertId, ownerId, faction, model, parkX, parkY, parkZ, parkRotX, parkRotY, parkRotZ, plateText, color1, color2);
     this.vehicleInsertId++;
     return this.vehicleInsertId - 1;
 }
示例#6
0
 private Dictionary <int, Dictionary <int, TaxiMeter> > taxiMeters = new Dictionary <int, Dictionary <int, TaxiMeter> >(); // Car ID maps to character ids
 public TaxiDriver(FactionEnums id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
示例#7
0
 public FirstResponder(FactionEnums id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
示例#8
0
 /// <summary>
 ///  Adds a vehicle into the vehicle manager
 /// </summary>
 /// <param name="id">Vehicle id</param>
 /// <param name="ownerId">Vehicle owner id</param>
 /// <param name="faction">Faction id</param>
 /// <param name="model">Vehicle model</param>
 /// <param name="parkX">Vehicle parking X position</param>
 /// <param name="parkY">Vehicle parking Y position</param>
 /// <param name="parkZ">Vehicle parking Z position</param>
 /// <param name="parkRotX">Vehicle parking X rotation</param>
 /// <param name="parkRotY">Vehicle parking Y rotation</param>
 /// <param name="parkRotZ">Vehicle parking Z rotation</param>
 /// <param name="plateText">Vehicle license plate text</param>
 /// <param name="color1">Vehicle primary color</param>
 /// <param name="color2">Vehicle secondary color</param>
 private void AddVehicleToManager(int id, int ownerId, FactionEnums faction, string model, float parkX, float parkY, float parkZ, float parkRotX, float parkRotY, float parkRotZ, string plateText, int color1, int color2)
 {
     RPVehicle v = new RPVehicle(id, ownerId, faction, API.shared.vehicleNameToModel(model), parkX, parkY, parkZ, parkRotX, parkRotY, parkRotZ, color1, color2, plateText, false);
     vehicles.Add(v);
 }
示例#9
0
 public FireDepartment(FactionEnums id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
示例#10
0
        ///

        public LawEnforcement(FactionEnums id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
        {
        }
示例#11
0
 /// <summary>
 /// Return a faction with certain id
 /// </summary>
 /// <param name="id"></param>
 /// <returns>A faction with id</returns>
 public Faction GetFactionWithId(FactionEnums id)
 {
     return(factions.Get(id));
 }
示例#12
0
 public RankedFaction(FactionEnums id, String name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
示例#13
0
 public Civilian(FactionEnums id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
示例#14
0
        protected bool IsCharacterValid(Client client, FactionEnums faction)
        {
            Character character = PlayerManager.Instance().GetActiveCharacterForClient(client);

            return(IsCharacterValid(character, faction));
        }