コード例 #1
0
ファイル: RPVehicle.cs プロジェクト: shox92/GTA-RP
        public RPVehicle(int id, int ownerId, FactionI 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(FactionI 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
 public Character(Player owner, int ID, String firstName, String lastName, FactionI 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;
 }
コード例 #4
0
ファイル: VehicleManager.cs プロジェクト: shox92/GTA-RP
        /// <summary>
        /// Creates a new vehicle into the database
        /// </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, FactionI 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);
        }
コード例 #5
0
 public Civilian(FactionI id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
コード例 #6
0
 public FirstResponder(FactionI id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
コード例 #7
0
ファイル: FactionManager.cs プロジェクト: shox92/GTA-RP
 /// <summary>
 /// Return a faction with certain id
 /// </summary>
 /// <param name="id"></param>
 /// <returns>A faction with id</returns>
 public Faction GetFactionWithId(FactionI id)
 {
     return(factions.Get(id));
 }
コード例 #8
0
ファイル: TaxiDriver.cs プロジェクト: shox92/GTA-RP
 public TaxiDriver(FactionI id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
コード例 #9
0
ファイル: FireDepartment.cs プロジェクト: shox92/GTA-RP
 public FireDepartment(FactionI id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }
コード例 #10
0
        ///

        public LawEnforcement(FactionI id, string name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
        {
        }
コード例 #11
0
ファイル: VehicleManager.cs プロジェクト: shox92/GTA-RP
        /// <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, FactionI 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);
        }
コード例 #12
0
 public RankedFaction(FactionI id, String name, int colorR, int colorG, int colorB) : base(id, name, colorR, colorG, colorB)
 {
 }