コード例 #1
0
 public static string GetUniteName(int ID)
 {
     foreach (UnitesLSPDInfo unite in UnitesList)
     {
         if (unite.ID == ID)
         {
             string name = String.Format("[{0}-", (ID + 1));
             if (unite.Membres.Count == 1)
             {
                 name += "Lincoln-";
             }
             if (unite.Membres.Count == 2)
             {
                 name += "Adams-";
             }
             if (unite.Membres.Count == 3)
             {
                 name += "Xray-";
             }
             name += String.Format("{0}]", VehiculeInfo.GetVehicleInfoByObject(unite.Vehicule).ID);
             return(name);
         }
     }
     return(null);
 }
コード例 #2
0
        public void Depanner(Client player, String id)
        {
            int          idveh  = Int32.Parse(id);
            VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoById(idveh);

            if (player.position.DistanceTo(objveh.handle.position) > 2)
            {
                API.sendChatMessageToPlayer(player, Constante.TuEsTropLoin);
            }
            else if (Inventaire.GetItemNumberInBDD(player, 4) <= 0)
            {
                API.sendChatMessageToPlayer(player, "Tu n'as pas de kit d'outils pour dépanner ton véhicule.");
            }
            else
            {
                if (API.getVehicleHealth(objveh.handle) >= 600)
                {
                    API.sendChatMessageToPlayer(player, "Tu dois emmener ton véhicule au garage pour le réparer complètement.");
                }
                else
                {
                    API.setVehicleHealth(objveh.handle, 600);
                    API.sendChatMessageToPlayer(player, "Tu viens de dépanner ton véhicule, emmène le au garage si tu veux le réparer complètement.");
                    Inventaire.RemoveItemToPlayerInventaire(player, 4, 1);
                }
            }
        }
コード例 #3
0
        public void Jeterclefveh(Client player, int IDVehicule)
        {
            VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoById(IDVehicule);

            if (objveh == null)
            {
                API.sendChatMessageToPlayer(player, Constante.message_idveh_incorrect);
            }
            if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 0)
            {
                API.sendChatMessageToPlayer(player, "~r~Tu ne possède pas de clé de ce vehicule.");
                return;
            }
            if (Concess.PlayerIsProprio(player, objveh.dbid))
            {
                if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 1)
                {
                    API.sendChatMessageToPlayer(player, "~r~Tu ne peux pas jeter la derniere clé de ton vehicule.");
                    return;
                }
                else
                {
                    Concess.RemoveKeyVehToPlayer(player, objveh.dbid);
                    API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~r~jeter ~s~une cléf du véhicule ~b~{0} ~s~.", IDVehicule));
                    return;
                }
            }
            else
            {
                Concess.RemoveKeyVehToPlayer(player, objveh.dbid);
                API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~r~jeter ~s~une cléf du véhicule ~b~{0} ~s~.", IDVehicule));
            }
        }
コード例 #4
0
        public void Creerpatrouille(Client player)
        {
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);

            if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
            {
                return;
            }
            if (objplayer.IsFactionDuty == false)
            {
                API.sendChatMessageToPlayer(player, Constante.PasEnService);
                return;
            }
            if (UnitesLSPDInfo.GetUniteLSPDInfoByMembre(player) != null)
            {
                API.sendChatMessageToPlayer(player, "~r~Tu es déjà dans une unité.");
                return;
            }
            if (!player.isInVehicle || VehiculeInfo.GetVehicleInfoByNetHandle(player.vehicle.handle).factionid != Constante.Faction_Police)
            {
                API.sendChatMessageToPlayer(player, "~r~Il faut etre dans un véhicule pour creer une unité.");
            }
            else
            {
                UnitesLSPDInfo Uniteobj = new UnitesLSPDInfo(player, player.vehicle);
                API.sendChatMessageToPlayer(player, "Numéro d'unité : ~g~" + (Uniteobj.ID + 1) + "~s~ | Numéro du véhicule : ~g~" + VehiculeInfo.GetVehicleInfoByNetHandle(player.vehicle.handle).ID);
                return;
            }
        }
コード例 #5
0
        public void Megaphone(Client player, string message)
        {
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);

            if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
            {
                return;
            }
            if (!objplayer.IsFactionDuty)
            {
                API.sendChatMessageToPlayer(player, Constante.PasEnService);
                return;
            }
            VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoByNetHandle(player.vehicle);

            if (!player.isInVehicle)
            {
                API.sendChatMessageToPlayer(player, "Tu n'as pas de ~r~mégaphone ~s~sur toi.");
                return;
            }
            if (objveh.factionid != Constante.Faction_Police)
            {
                API.sendChatMessageToPlayer(player, "Tu n'as pas de ~r~mégaphone ~s~dans ton véhicule.");
            }
            else
            {
                Fonction.SendCloseMessage(player, 40.0f, Constante.JauneMegaphone, Fonction.RemoveUnderscore(player.name) + " dit au mégaphone : " + message);
            }
        }
コード例 #6
0
        public void SavePosVehicule(int IDBDDVeh)
        {
            VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh);
            Vector3      vpos   = API.getEntityPosition(objveh.handle);
            Vector3      vrot   = API.getEntityRotation(objveh.handle);

            API.exported.database.executeQuery("UPDATE Vehicules SET Locked='" + Convert.ToInt32(API.getVehicleLocked(objveh.handle)) + "',PosX='" + vpos.X + "',PosY='" + vpos.Y + "',PosZ='" + vpos.Z + "',RotX='" + vrot.X + "',RotY='" + vrot.Y + "',RotZ='" + vrot.Z + "',Dimension='" + API.getEntityDimension(objveh.handle) + "',DansGarage='" + Convert.ToInt32(objveh.Dansgarage) + "'  WHERE ID = '" + IDBDDVeh + "'");
        }
コード例 #7
0
        public static void Delete(NetHandle vehicule)
        {
            VehiculeInfo vehicleobj = GetVehicleInfoByNetHandle(vehicule);

            //API.shared.explodeVehicle(vehicule);
            API.shared.deleteEntity(vehicleobj.label);
            API.shared.deleteEntity(vehicule);
            VehiculeList.Remove(vehicleobj);
            vehicleobj = null;
        }
コード例 #8
0
 public void SaveTuningVehicule(int IDBDDVeh)
 {
     string[] mod  = { "FrontBumper", "RearBumper", "SideSkirt", "Exhaust", "Frame", "Grille", "Hood", "Fender", "RightFender", "Roof", "Engine", "Brakes", "Transmission", "Horns", "Suspension", "Armor", "Turbo", "Xenon", "FrontWheels", "BackWheels", "PlateHolders", "TrimDesign", "Ornaments", "DialDesign", "SteeringWheel", "ShiftLever", "Plaques", "Hydraulics", "Livery", "Plate", "Color1", "Color2", "WindowTint" };
     int[]    mod2 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 22, 23, 24, 25, 27, 28, 30, 33, 34, 35, 38, 48, 62, 66, 67, 69 };
     if (VerifTableModVehExiste(IDBDDVeh))
     {
         string requete = "UPDATE ModVehicules SET ";
         if (API.getEntityData(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, "Spoilers") != null)
         {
             requete += String.Format("Spoilers={0}", API.getVehicleMod(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, 0));
         }
         else
         {
             requete += "Spoilers=-1";
         }
         for (int i = 0; i < mod.Length; i++)
         {
             if (API.getEntityData(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, mod[i]) == null)
             {
                 requete += String.Format(",{0}=-1", mod[i]);
             }
             else
             {
                 requete += String.Format(",{0}={1}", mod[i], API.getVehicleMod(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, mod2[i]));
             }
         }
         requete += " WHERE IDVeh = '" + IDBDDVeh + "'";
         API.exported.database.executeQuery(requete);
     }
     else
     {
         string requete;
         if (API.getEntityData(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, "Spoilers") != null)
         {
             requete = "INSERT INTO ModVehicules VALUES ('','" + IDBDDVeh + "','" + API.getEntityData(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, "Spoilers") + "'";
         }
         else
         {
             requete = "INSERT INTO ModVehicules VALUES ('','" + IDBDDVeh + "','-1'";
         }
         for (int i = 0; i < mod2.Length; i++)
         {
             if (API.getEntityData(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, mod[i]) == null)
             {
                 requete += ", '-1'";
             }
             else
             {
                 requete += String.Format(", {0}", API.getVehicleMod(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, mod2[i]));
             }
         }
         requete += ");";
         API.exported.database.executeQuery(requete);
     }
 }
コード例 #9
0
        public void spawnvehicule()
        {
            DataTable result = API.exported.database.executeQueryWithResult("SELECT * FROM Vehicules");

            if (result.Rows.Count != 0)
            {
                foreach (DataRow row in result.Rows)
                {
                    string vposx  = Convert.ToString(row["PosX"]);
                    string vposy  = Convert.ToString(row["PosY"]);
                    string vposz  = Convert.ToString(row["PosZ"]);
                    string vrotx  = Convert.ToString(row["RotX"]);
                    string vroty  = Convert.ToString(row["RotY"]);
                    string vrotz  = Convert.ToString(row["RotZ"]);
                    int    model  = Convert.ToInt32(row["model"]);
                    int    color1 = Convert.ToInt32(row["color1"]);
                    int    color2 = Convert.ToInt32(row["color2"]);
                    int    vid    = Convert.ToInt32(row["ID"]);
                    string plaque = Convert.ToString(row["Plaque"]);

                    Vector3 rotv = new Vector3(float.Parse(vrotx), float.Parse(vroty), float.Parse(vrotz));
                    Vector3 posv = new Vector3(float.Parse(vposx), float.Parse(vposy), float.Parse(vposz));
                    if (Convert.ToInt32(row["EnVente"]) == 1)
                    {
                        VehiculeInfo vehicleobj = new VehiculeInfo((VehicleHash)model, posv, rotv, color1, color2, plaque, 0);
                        vehicleobj.Dansgarage            = false;
                        vehicleobj.EnVente               = true;
                        vehicleobj.PrixVente             = Convert.ToInt32(row["PrixVente"]);
                        vehicleobj.handle.invincible     = true;
                        vehicleobj.handle.freezePosition = true;
                        vehicleobj.dbid = Convert.ToInt32(row["ID"]);
                        API.setVehicleNumberPlate(vehicleobj.handle, "A VENDRE");
                        VehiculeInfo.SetVehiculeEssence(vehicleobj, Convert.ToInt32(row["Essence"]));
                        LoadMods(vehicleobj.dbid);
                    }
                    if (Convert.ToBoolean(row["Spawned"]) == true && Convert.ToInt32(row["EnVente"]) == 0)
                    {
                        VehiculeInfo vehicleobj = new VehiculeInfo((VehicleHash)model, posv, rotv, color1, color2, plaque, 0);
                        VehiculeInfo.SetVehiculeEssence(vehicleobj, Convert.ToInt32(row["Essence"]));
                        API.setVehicleEngineStatus(vehicleobj.handle, false);
                        API.setEntityDimension(vehicleobj.handle, Convert.ToInt32(row["Dimension"]));
                        vehicleobj.Dansgarage   = Convert.ToBoolean(row["DansGarage"]);
                        vehicleobj.spawned      = Convert.ToBoolean(row["Spawned"]);
                        vehicleobj.jobid        = Convert.ToInt32(row["jobid"]);
                        vehicleobj.factionid    = Convert.ToInt32(row["factionid"]);
                        vehicleobj.IDBDDProprio = Convert.ToInt32(row["Proprio"]);
                        vehicleobj.dbid         = Convert.ToInt32(row["ID"]);
                        API.setVehicleLocked(vehicleobj.handle, Convert.ToBoolean(row["Locked"]));
                        vehicleobj.locked = Convert.ToBoolean(row["Locked"]);
                        LoadMods(vehicleobj.dbid);
                    }
                }
            }
        }
コード例 #10
0
ファイル: Concess.cs プロジェクト: kASANNN/GenerationFiveTest
        public static bool PlayerHaveVehicleKeys(Client player, int IDBDDVehicule)
        {
            PlayerInfo   objplayer   = PlayerInfo.GetPlayerInfoObject(player);
            VehiculeInfo objvehicule = VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVehicule);

            if (ClefInfo.GetPlayerKeysByObjetID(objplayer.dbid, IDBDDVehicule).Count < 1)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
コード例 #11
0
        /* Get le vehicule le plus pres du joueurs dans un rayon de range */
        public static VehiculeInfo GetVehicleCloserPlayer(Client sender, float range = 2.0f)
        {
            VehiculeInfo returned = null;
            float        distance = range;

            foreach (VehiculeInfo vehicle in VehiculeInfo.VehiculeList)
            {
                if (sender.position.DistanceTo(vehicle.handle.position) < range && sender.position.DistanceTo(vehicle.handle.position) < distance)
                {
                    returned = vehicle;
                    distance = sender.position.DistanceTo(vehicle.handle.position);
                }
            }
            return(returned);
        }
コード例 #12
0
ファイル: Essence.cs プロジェクト: kASANNN/GenerationFiveTest
 public void essence() //Conssomation d'essence -1 toutes les 10sec
 {
     API.delay(10000, false, () =>
     {
         foreach (VehiculeInfo veh in VehiculeInfo.VehiculeList)
         {
             if (API.getVehicleEngineStatus(veh.handle))
             {
                 VehiculeInfo.SetVehiculeEssence(veh, veh.essence - 1);
                 if (veh.essence <= 0)
                 {
                     API.setVehicleEngineStatus(veh.handle, false);
                 }
             }
         }
     });
 }
コード例 #13
0
        public void OnPlayerEnterVehicleHandle(Client player, NetHandle vehicle, int targetSeat)
        {
            PlayerInfo   objplayer   = PlayerInfo.GetPlayerInfoObject(player);
            VehiculeInfo objvehicule = VehiculeInfo.GetVehicleInfoByNetHandle(vehicle);

            if (objvehicule.jobid == Constante.Job_Convoyeur)
            {
                if (!Fonction.IsPlayerInFaction(objplayer, "Gardien", true))
                {
                    return;
                }
            }
            if (objvehicule.EnVente == true)
            {
                API.triggerClientEvent(player, "MenuVehConcess");
            }
        }
コード例 #14
0
        public void Forcer(Client player, String option)
        {
            NetHandle    veh    = CreationMenus.GetClosestVehicle(player);
            VehiculeInfo vehobj = VehiculeInfo.GetVehicleInfoByNetHandle(veh);

            if (option == "vehicule")
            {
                if (API.getPlayerCurrentWeapon(player) == WeaponHash.Crowbar)
                {
                    API.delay(5000, true, () =>
                    {
                        Random aleatoire = new Random();
                        int resultat     = aleatoire.Next(1, 10);
                        if (resultat == 10)
                        {
                            API.sendChatMessageToPlayer(player, "Tu as ~g~réussis ~s~à forcer la porte du véhicule.");
                            API.setVehicleLocked(vehobj.handle, false);
                            vehobj.locked = false;
                            return;
                        }
                        else if (resultat >= 3)
                        {
                            API.sendChatMessageToPlayer(player, "Tu n'as ~r~pas réussis ~s~à forcer la porte du véhicule.");
                            return;
                        }
                        else
                        {
                            API.removePlayerWeapon(player, WeaponHash.Crowbar);
                            API.sendChatMessageToPlayer(player, "Tu as ~g~réussis ~s~à forcer la porte du véhicule, mais ton pied de biche s'est cassé.");
                            API.setVehicleLocked(vehobj.handle, false);
                            vehobj.locked = false;
                        }
                    });
                }
                else
                {
                    API.sendChatMessageToPlayer(player, "Tu n'as rien pour ~r~forcer ~s~la porte de ce véhicule.");
                }
            }

            if (option == "maison")
            {
                API.sendChatMessageToPlayer(player, "J'arrive bientôt.");
            }
        }
コード例 #15
0
        public void Reparer(Client player, String id)
        {
            int          idveh     = Int32.Parse(id);
            PlayerInfo   objplayer = PlayerInfo.GetPlayerInfoObject(player);
            VehiculeInfo objveh    = VehiculeInfo.GetVehicleInfoById(idveh);

            if (player.position.DistanceTo(objveh.handle.position) > 2)
            {
                API.sendChatMessageToPlayer(player, Constante.TuEsTropLoin);
            }
            else
            {
                API.repairVehicle(objveh.handle);
                API.sendChatMessageToPlayer(player, "Tu viens de ~b~réparer ~s~ce véhicule.");
                var PayeEnAttente = objplayer.pendingpaye;
                objplayer.pendingpaye = PayeEnAttente + Constante.PayeReparer;
            }
        }
コード例 #16
0
        public void Plein(Client player, String id, int Litres)
        {
            int          idveh     = Int32.Parse(id);
            PlayerInfo   objplayer = PlayerInfo.GetPlayerInfoObject(player);
            VehiculeInfo objveh    = VehiculeInfo.GetVehicleInfoById(idveh);

            if (player.position.DistanceTo(objveh.handle.position) > 2)
            {
                API.sendChatMessageToPlayer(player, Constante.TuEsTropLoin);
            }
            else
            {
                VehiculeInfo.SetVehiculeEssence(objveh, Litres);
                API.sendChatMessageToPlayer(player, "Tu viens de mettre ~b~" + Litres + " ~s~dans le réservoir.");
                var PayeEnAttente = objplayer.pendingpaye;
                objplayer.pendingpaye = PayeEnAttente + Litres;
            }
        }
コード例 #17
0
        public void LoadMods(int IDBDDVeh)
        {
            DataTable result = API.exported.database.executeQueryWithResult("SELECT * FROM ModVehicules WHERE IDVeh = '" + IDBDDVeh + "'");

            foreach (DataRow row in result.Rows)
            {
                string[] mod  = { "Spoilers", "FrontBumper", "RearBumper", "SideSkirt", "Exhaust", "Frame", "Grille", "Hood", "Fender", "RightFender", "Roof", "Engine", "Brakes", "Transmission", "Horns", "Suspension", "Armor", "Turbo", "Xenon", "FrontWheels", "BackWheels", "PlateHolders", "TrimDesign", "Ornaments", "DialDesign", "SteeringWheel", "ShiftLever", "Plaques", "Hydraulics", "Livery", "Plate", "Color1", "Color2", "WindowTint" };
                int[]    mod2 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 22, 23, 24, 25, 27, 28, 30, 33, 34, 35, 38, 48, 62, 66, 67, 69 };
                for (int i = 0; i < mod.Length; i++)
                {
                    if (Convert.ToInt32(row[mod[i]]) != -1)
                    {
                        API.setEntityData(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, mod[i], Convert.ToInt32(row[mod[i]]));
                        API.setVehicleMod(VehiculeInfo.GetVehicleInfoByIdBDD(IDBDDVeh).handle, mod2[i], Convert.ToInt32(row[mod[i]]));
                    }
                }
            }
        }
コード例 #18
0
 private void OnResourceStopHandler()
 {
     foreach (var veh in API.getAllVehicles())
     {
         VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoByNetHandle(veh);
         if (objveh == null)
         {
             API.deleteEntity(veh);
         }
         else
         {
             SaveTuningVehicule(objveh.dbid);
             if (objveh.factionid != 0 || objveh.jobid != 0)
             {
                 SaveEssenceVehicule(objveh.dbid, objveh.essence);
                 VehiculeInfo.Delete(veh);
             }
             else
             {
                 SavePosVehicule(objveh.dbid);
                 SaveEssenceVehicule(objveh.dbid, objveh.essence);
                 VehiculeInfo.Delete(veh);
             }
         }
     }
     API.consoleOutput("[SAVE] Vehicules OK.");
     foreach (var label in API.getAllLabels())
     {
         API.deleteEntity(label);
     }
     API.consoleOutput("[DELETE] Labels OK.");
     foreach (var blip in API.getAllBlips())
     {
         API.deleteEntity(blip);
     }
     API.consoleOutput("[DELETE] Blips OK.");
     foreach (StationsEssencesInfo station in StationsEssencesInfo.StationsList)
     {
         API.exported.database.executeQuery("UPDATE StationsEssences SET Stockage = '" + station.Stockage + "', Argents = '" + station.Argents + "' WHERE ID = '" + station.IDBDD + "'");
     }
     API.consoleOutput("[SAVE] Station Essence OK.");
     SaveATM();
     SaveClefs();
 }
コード例 #19
0
        public void Verifiervehicule(Client player, String id)
        {
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);

            if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
            {
                return;
            }
            if (!objplayer.IsFactionDuty)
            {
                API.sendChatMessageToPlayer(player, Constante.PasEnService);
                return;
            }
            int idveh = Int32.Parse(id);
            {
                VehiculeInfo objvehicule = VehiculeInfo.GetVehicleInfoById(idveh);
                API.sendChatMessageToPlayer(player, "Le véhicule appartient à");
            }
        }
コード例 #20
0
        public void Donnerclefveh(Client player, String idOrName, int IDVehicule)
        {
            PlayerInfo objtarget = PlayerInfo.GetPlayerInfotByIdOrName(idOrName);

            if (objtarget == null)
            {
                API.sendChatMessageToPlayer(player, Constante.message_id_incorrect);
            }
            VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoById(IDVehicule);

            if (objveh == null)
            {
                API.sendChatMessageToPlayer(player, Constante.message_idveh_incorrect);
            }
            if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 0)
            {
                API.sendChatMessageToPlayer(player, "~r~Tu ne possède pas de clé de ce vehicule.");
                return;
            }
            if (Concess.PlayerIsProprio(player, objveh.dbid))
            {
                if (Concess.GetVehKeyNumberPlayer(player, objveh.dbid) == 1)
                {
                    API.sendChatMessageToPlayer(player, "~r~Tu ne peux pas donner la derniere clé de ton vehicule.");
                    return;
                }
                else
                {
                    Concess.RemoveKeyVehToPlayer(player, objveh.dbid);
                    Concess.AddKeyVehToPlayer(objtarget.Handle, objveh.dbid);
                    API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~g~donner ~s~une clé du véhicule ~b~{0} ~s~au joueur ~b~{1}~s~.", IDVehicule, Fonction.RemoveUnderscore(objtarget.PlayerName)));
                    API.sendChatMessageToPlayer(objtarget.Handle, String.Format("~b~{0} ~s~vient de te ~g~donner ~s~une clé du véhicule ~b~{1}~s~.", Fonction.RemoveUnderscore(player.name), IDVehicule));
                    return;
                }
            }
            else
            {
                Concess.RemoveKeyVehToPlayer(player, objveh.dbid);
                Concess.AddKeyVehToPlayer(objtarget.Handle, objveh.dbid);
                API.sendChatMessageToPlayer(player, String.Format("Tu viens de ~g~donner ~s~une cléf du véhicule ~b~{0} ~s~au joueur ~b~{1}~s~.", IDVehicule, Fonction.RemoveUnderscore(objtarget.PlayerName)));
                API.sendChatMessageToPlayer(objtarget.Handle, String.Format("~b~{0} ~s~vient de te ~g~donner ~s~une clé du véhicule ~b~{1}~s~.", Fonction.RemoveUnderscore(player.name), IDVehicule));
            }
        }
コード例 #21
0
ファイル: Concess.cs プロジェクト: kASANNN/GenerationFiveTest
        public void RemplacementConcessVendu()
        {
            DataTable result = API.exported.database.executeQueryWithResult("SELECT * FROM Concess WHERE Vendu = '1'");

            if (result.Rows.Count != 0)
            {
                foreach (DataRow row in result.Rows)
                {
                    Random       aleatoire  = new Random();
                    int          model      = aleatoire.Next(0, modelvehconcess.Length);
                    int          color1     = aleatoire.Next(0, 159);
                    int          color2     = aleatoire.Next(0, 159);
                    string       vposx      = String.Format("" + row["PosX"]);
                    string       vposy      = String.Format("" + row["PosY"]);
                    string       vposz      = String.Format("" + row["PosZ"]);
                    string       vrotx      = String.Format("" + row["RotX"]);
                    string       vroty      = String.Format("" + row["RotY"]);
                    string       vrotz      = String.Format("" + row["RotZ"]);
                    Vector3      rotv       = new Vector3(float.Parse(vrotx), float.Parse(vroty), float.Parse(vrotz));
                    Vector3      posv       = new Vector3(float.Parse(vposx), float.Parse(vposy), float.Parse(vposz));
                    VehiculeInfo vehicleobj = new VehiculeInfo((VehicleHash)modelvehconcess[model], posv, rotv, color1, color2, "A VENDRE", 0);
                    API.exported.database.executeQuery("INSERT INTO Vehicules VALUES ('','0','0','0','" + modelvehconcess[model] + "','" + color1 + "','" + color2 + "','" + posv.X + "','" + posv.Y + "','" + posv.Z + "','" + rotv.X + "','" + rotv.Y + "','" + rotv.Z + "', '1', '" + prixvehconcess[model] + "', '100', 'A VENDRE', '1', '0', '0', '0')");
                    DataTable result2 = API.shared.exported.database.executeQueryWithResult("SELECT LAST_INSERT_ID();");
                    foreach (DataRow row2 in result2.Rows)
                    {
                        vehicleobj.dbid = Convert.ToInt32(row2[0]);
                        break;
                    }
                    vehicleobj.dbid = GetVehiculeIDBBD(posv);
                    API.exported.database.executeQuery("UPDATE Concess SET Vendu ='0' WHERE ID = '" + Convert.ToInt32(row["ID"]) + "'");
                    API.exported.database.executeQuery("UPDATE Concess SET IDVeh ='" + vehicleobj.dbid + "' WHERE ID = '" + Convert.ToInt32(row["ID"]) + "'");
                    vehicleobj.EnVente               = true;
                    vehicleobj.PrixVente             = prixvehconcess[model];
                    vehicleobj.handle.invincible     = true;
                    vehicleobj.handle.freezePosition = true;
                    API.setVehicleNumberPlate(vehicleobj.handle, "A VENDRE");
                }
            }
        }
コード例 #22
0
        public void Vspawn(Client player, int Numero)
        {
            DataTable result = API.exported.database.executeQueryWithResult("SELECT * FROM Vehicules WHERE Proprio = '" + PlayerInfo.GetPlayerInfoObject(player).dbid + "'");

            if (result.Rows.Count == 0)
            {
                API.sendChatMessageToPlayer(player, "~r~Tu n'es proprietaire d'aucuns vehicules.");
                return;
            }
            if (result.Rows.Count < Numero - 1)
            {
                API.sendChatMessageToPlayer(player, "~r~Ce vehicule n'existe pas.");
                return;
            }
            else
            {
                if (Convert.ToBoolean(result.Rows[Numero - 1]["Spawned"]) == false)
                {
                    Vector3      PosVspawn  = new Vector3(Convert.ToInt32(result.Rows[Numero - 1]["PosX"]), Convert.ToInt32(result.Rows[Numero - 1]["PosY"]), Convert.ToInt32(result.Rows[Numero - 1]["PosZ"]));
                    Vector3      RotVspawn  = new Vector3(Convert.ToInt32(result.Rows[Numero - 1]["RotX"]), Convert.ToInt32(result.Rows[Numero - 1]["RotY"]), Convert.ToInt32(result.Rows[Numero - 1]["RotZ"]));
                    VehiculeInfo vehicleobj = new VehiculeInfo((VehicleHash)result.Rows[Numero - 1]["model"], PosVspawn, RotVspawn, Convert.ToInt32(result.Rows[Numero - 1]["color1"]), Convert.ToInt32(result.Rows[Numero - 1]["color2"]), Convert.ToString(result.Rows[Numero - 1]["plaque"]), 0);
                    vehicleobj.spawned = true;
                    API.exported.database.executeQuery("UPDATE Vehicules SET Spawned = '1' WHERE ID = '" + Convert.ToInt32(result.Rows[Numero - 1]["ID"]) + "'");
                    vehicleobj.jobid        = Convert.ToInt32(result.Rows[Numero - 1]["jobid"]);
                    vehicleobj.factionid    = Convert.ToInt32(result.Rows[Numero - 1]["factionid"]);
                    vehicleobj.IDBDDProprio = Convert.ToInt32(result.Rows[Numero - 1]["Proprio"]);
                    vehicleobj.dbid         = Convert.ToInt32(result.Rows[Numero - 1]["ID"]);
                    API.setVehicleLocked(vehicleobj.handle, Convert.ToBoolean(result.Rows[Numero - 1]["Locked"]));
                    vehicleobj.locked = Convert.ToBoolean(result.Rows[Numero - 1]["Locked"]);
                    API.sendChatMessageToPlayer(player, "Tu viens de spawn le vehicule n°~g~" + Numero + "~s~.");
                    return;
                }
                else
                {
                    API.sendChatMessageToPlayer(player, "~r~Ce vehicule est déjà spawn.");
                }
            }
        }
コード例 #23
0
        public void Changercouleur(Client player, String id, int couleur1, int couleur2)
        {
            int          idveh     = Int32.Parse(id);
            PlayerInfo   objplayer = PlayerInfo.GetPlayerInfoObject(player);
            VehiculeInfo objveh    = VehiculeInfo.GetVehicleInfoById(idveh);

            if (player.position.DistanceTo(objveh.handle.position) > 2)
            {
                API.sendChatMessageToPlayer(player, Constante.TuEsTropLoin);
            }
            else
            {
                if ((couleur1 < 0 || couleur1 > 159) && couleur1 != -1)
                {
                    API.sendChatMessageToPlayer(player, "La couleur principale doit être comprise entre 0 et 159.");
                }
                if ((couleur2 < 0 || couleur2 > 159) && couleur2 != -1)
                {
                    API.sendChatMessageToPlayer(player, "La couleur secondaire doit être comprise entre 0 et 159.");
                }
                if (couleur1 == -1 && couleur2 == -1)
                {
                    return;
                }
                if (couleur1 != -1)
                {
                    objveh.color1 = couleur1;
                }
                if (couleur2 != -1)
                {
                    objveh.color2 = couleur2;
                }
                API.sendChatMessageToPlayer(player, "Tu as repeint le véhicule en couleur : ~b~" + couleur1 + " ~s~et ~b~" + couleur2 + "~s~.");
                var PayeEnAttente = objplayer.pendingpaye;
                objplayer.pendingpaye = PayeEnAttente + Constante.PayeCouleur;
            }
        }
コード例 #24
0
        public void Vliste(Client player)
        {
            DataTable result = API.exported.database.executeQueryWithResult("SELECT * FROM Vehicules WHERE Proprio = '" + PlayerInfo.GetPlayerInfoObject(player).dbid + "'");

            if (result.Rows.Count == 0)
            {
                API.sendChatMessageToPlayer(player, "~r~Tu n'es proprietaire d'aucuns vehicules.");
            }
            else
            {
                API.sendChatMessageToPlayer(player, "~g~Vehicules dont tu es le propriétaire :");
                for (int i = 0; i < result.Rows.Count; i++)
                {
                    if (VehiculeInfo.GetVehicleInfoByIdBDD(Convert.ToInt32(result.Rows[i]["ID"])) == null)
                    {
                        API.sendChatMessageToPlayer(player, String.Format("~g~{0}~s~ : {1} Etat : ~r~Garé~s~.", i + 1, API.getVehicleDisplayName((VehicleHash)result.Rows[i]["model"])));
                    }
                    else
                    {
                        API.sendChatMessageToPlayer(player, String.Format("~g~{0}~s~ : {1} Etat : ~g~Spawn~s~.", i + 1, API.getVehicleDisplayName((VehicleHash)result.Rows[i]["model"])));
                    }
                }
            }
        }
コード例 #25
0
 private void OnVehicleDeathHandler(NetHandle vehicle)
 {
     VehiculeInfo.Delete(vehicle);
 }
コード例 #26
0
 public void ScriptEvent(Client sender, PlayerInfo objplayer, string eventName)
 {
     if (eventName == "ConvoyeurKeyPressed" && !API.isPlayerInAnyVehicle(sender))
     {
         VehiculeInfo objvehicule = VehiculeInfo.GetVehicleArroundPlayer(sender);
         if (objvehicule == null)
         {
             return; /* ??? c bon sa*/
         }
         if (objplayer.sacbanque == true)
         {
             var sacs = objvehicule.sacs;
             if (sacs != 5)
             {
                 var asacs = sacs + 1;
                 objvehicule.sacs    = asacs;
                 objplayer.sacbanque = false;
                 API.setPlayerClothes(sender, 5, 0, 0);
                 if (asacs == 5)
                 {
                     API.sendChatMessageToPlayer(sender, "~g~Le camion est plein ! Tu peux y aller !");
                 }
             }
         }
         else
         {
             var sacs = objvehicule.sacs;
             if (sacs != 0)
             {
                 objplayer.sacbanque = true;
                 var nsacs = sacs - 1;
                 API.setPlayerClothes(sender, 5, 45, 0);
                 objvehicule.sacs = nsacs;
                 if (nsacs == 0)
                 {
                     API.sendChatMessageToPlayer(sender, "~g~Tu viens de prendre le dernier sac ! Remplis l'ATM puis choisis entre recommencer (se rendre au point indiqué) ou arreter (/stopjob) !");
                     API.triggerClientEvent(sender, "pointconv");
                 }
             }
         }
     }
     if (eventName == "DepotConvKey" && !API.isPlayerInAnyVehicle(sender) && sender.position.DistanceTo(Constante.Pos_DepotConvoyeur) < 2)
     {
         if (Fonction.IsPlayerInFaction(objplayer, "Gardien", false))
         {
             if (objplayer.IsJobDuty != true)
             {
                 if (objplayer.sexe == 0)
                 {
                     int[] draw = { 0, 0, -1, 44, 31, 0, 24, 0, 23, 0, 0, 130 };
                     int[] tex  = { 0, 0, -1, 0, 0, 0, 0, 0, 2, 0, 0, 0 };
                     for (int i = 0; i < draw.Length; i++)
                     {
                         API.setPlayerClothes(sender, i, draw[i], tex[i]);
                     }
                     API.setPlayerAccessory(sender, 0, 65, 0);
                 }
                 else
                 {
                     int[] draw = { 0, 0, -1, 49, 32, 0, 25, 0, 2, 0, 0, 127 };
                     int[] tex  = { 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                     for (int i = 0; i < draw.Length; i++)
                     {
                         API.setPlayerClothes(sender, i, draw[i], tex[i]);
                     }
                     API.setPlayerAccessory(sender, 0, 64, 0);
                 }
                 objplayer.IsJobDuty = true;
                 objplayer.sacbanque = false;
                 API.sendNotificationToPlayer(sender, "~g~Montes dans un ~r~camion ~g~et rends toi au ~r~point ~g~indiqué.");
                 API.triggerClientEvent(sender, "pointconv");
             }
             else
             {
                 API.sendNotificationToPlayer(sender, "~g~Tu viens de te retirer du service.");
                 Connexion lv = new Connexion();
                 API.clearPlayerAccessory(sender, 0);
                 lv.LoadVetements(sender);
                 lv.LoadAccessoires(sender);
                 objplayer.IsJobDuty = false;
             }
         }
         else
         {
             API.sendChatMessageToPlayer(sender, "~r~Tu n'es pas Convoyeur de Fonds");
         }
     }
     if (eventName == "ConvoyeurKeyPressed" && API.isPlayerInAnyVehicle(sender) && objplayer.retourconv == true && sender.position.DistanceTo(new Vector3(490.227, -1402.756, 29.32529)) < 4)
     {
         VehiculeInfo objvehicule = VehiculeInfo.GetVehicleInfoByNetHandle(sender.vehicle);
         if (objvehicule.jobid == Constante.Job_Convoyeur)
         {
             Client[] jo = API.getVehicleOccupants(objvehicule.handle);
             foreach (Client value in jo)
             {
                 API.warpPlayerOutOfVehicle(value);
                 objplayer.retourconv = false;
             }
             API.setEntityPosition(objvehicule.handle, objvehicule.pos);
             API.setEntityRotation(objvehicule.handle, objvehicule.rot);
             objvehicule.sacs = 0;
             API.setVehicleEngineStatus(objvehicule.handle, false);
         }
     }
 }
コード例 #27
0
ファイル: Essence.cs プロジェクト: kASANNN/GenerationFiveTest
        //event Essence

        public void ScriptEvent(Client sender, PlayerInfo objplayer, string eventName)
        {
            int prixessence = 2;

            if (eventName == "RefuelKeyPressed")
            {
                if (isPumpFuel(sender) && !API.isPlayerInAnyVehicle(sender))
                {
                    VehiculeInfo         vehobj     = VehiculeInfo.GetVehicleCloserPlayer(sender, 5);
                    PompesEssencesInfo   pompeobj   = PompesEssencesInfo.GetPompeInfoByPos(sender.position);
                    StationsEssencesInfo stationobj = StationsEssencesInfo.GetStationInfoByIDBDD(pompeobj.IDBDD);
                    if (vehobj == null)
                    {
                        API.sendChatMessageToPlayer(sender, "~r~Pas de véhicule près de toi.");
                        return;
                    }
                    if (vehobj.stopessence != true)
                    {
                        if (stationobj.Stockage <= 0)
                        {
                            API.sendChatMessageToPlayer(sender, "~r~La station essence est en pénurie.");
                            vehobj.stopessence = true;
                            API.delay(5000, true, () =>
                            {
                                vehobj.stopessence = false;
                            });
                            return;
                        }
                        if (vehobj.essence != 100)
                        {
                            API.sendChatMessageToPlayer(sender, "~g~Remplissage en cours ....");
                            VehiculeInfo.SetVehiculeEssence(vehobj, vehobj.essence + 1);
                            objplayer.money      = objplayer.money - prixessence;
                            stationobj.Stockage -= 1;
                            API.setTextLabelText(stationobj.textlabel, "Station n°~g~" + stationobj.ID + " ~s~| Stockage :~b~ " + stationobj.Stockage + "~s~L");
                            stationobj.Argents = stationobj.Argents + prixessence;
                            API.triggerClientEvent(sender, "update_money_display", objplayer.money);
                            return;
                        }
                        else
                        {
                            API.sendChatMessageToPlayer(sender, "~r~Le reservoir du vehicule est plein.");
                            vehobj.stopessence = true;
                            API.delay(5000, true, () =>
                            {
                                vehobj.stopessence = false;
                            });
                            return;
                        }
                    }
                }
            }
            if (eventName == "RefuelKeyReleased")
            {
                if (isPumpFuel(sender) && !API.isPlayerInAnyVehicle(sender))
                {
                    API.delay(1000, true, () =>
                    {
                        API.shared.triggerClientEvent(sender, "stop_update_money");
                    });
                    return;
                }
            }
        }
コード例 #28
0
 public static void SetVehiculeEssence(VehiculeInfo veh, int value)
 {
     veh.essence = value;
     API.shared.setEntitySyncedData(veh.handle, "essence", value);
     return;
 }
コード例 #29
0
        public void ClientEvent(Client player, PlayerInfo objplayer, string eventName)
        {
            switch (eventName)
            {
                #region Bouton E
            case "Bouton.E":
                //Entrée Auto-Ecole
                if (!player.isInVehicle && player.position.DistanceTo(Constante.Pos_EntrerAutoEcole) < 2)
                {
                    API.setEntityPosition(player, Constante.Pos_SortieAutoEcole);
                    return;
                }

                if (!player.isInVehicle && player.position.DistanceTo(Constante.Pos_EntrerPrison) < 4 && objplayer.factionid == Constante.Faction_Gardien)
                {
                    API.setEntityPosition(player, Constante.Pos_SortiePrison);
                    objplayer.IsFactionDuty = true;
                    API.sendChatMessageToPlayer(player, "~#d2d628~", "Tu viens de prendre ton service.");

                    if (objplayer.sexe == 0)
                    {
                        API.setPlayerClothes(player, 3, 0, 0);
                        API.setPlayerClothes(player, 4, 35, 0);
                        API.setPlayerClothes(player, 5, 0, 0);
                        API.setPlayerClothes(player, 6, 25, 0);
                        API.setPlayerClothes(player, 7, 0, 0);
                        API.setPlayerClothes(player, 8, 58, 0);
                        API.setPlayerClothes(player, 11, 55, 0);
                    }
                    else
                    {
                        API.setPlayerClothes(player, 3, 14, 0);
                        API.setPlayerClothes(player, 4, 34, 0);
                        API.setPlayerClothes(player, 5, 0, 0);
                        API.setPlayerClothes(player, 6, 25, 0);
                        API.setPlayerClothes(player, 7, 0, 0);
                        API.setPlayerClothes(player, 8, 35, 0);
                        API.setPlayerClothes(player, 11, 48, 0);
                    }
                    API.givePlayerWeapon(player, WeaponHash.Flashlight, 1, true, true);
                    API.givePlayerWeapon(player, WeaponHash.StunGun, 1, true, true);
                    API.givePlayerWeapon(player, WeaponHash.Nightstick, 1, true, true);
                    return;
                }
                if (!player.isInVehicle && player.position.DistanceTo(Constante.Pos_SortiePrison) < 4 && objplayer.factionid == Constante.Faction_Gardien)
                {
                    API.setEntityPosition(player, Constante.Pos_EntrerPrison);
                    objplayer.IsFactionDuty = false;
                    API.removeAllPlayerWeapons(player);
                    objplayer.armure = 0;
                    API.sendChatMessageToPlayer(player, "~#d2d628~", "Tu viens de terminer ton service.");
                    API.call("Connexion", "LoadVetements", player);
                    API.call("Connexion", "LoadAccessoires", player);
                    return;
                }

                //Sortie Auto-Ecole
                if (!player.isInVehicle && player.position.DistanceTo(Constante.Pos_SortieAutoEcole) < 2)
                {
                    API.setEntityPosition(player, Constante.Pos_EntrerAutoEcole);
                    return;
                }

                //Job eboueur
                if (!player.isInVehicle && player.position.DistanceTo(Constante.Pos_ServiceEboueur) < 2)
                {
                    if (objplayer.jobid == Constante.Job_Eboueur)
                    {
                        if (objplayer.IsJobDuty == false)
                        {
                            API.setPlayerClothes(player, 3, 119, 0);
                            API.setPlayerClothes(player, 4, 36, 0);
                            API.setPlayerClothes(player, 6, 51, 0);
                            API.setPlayerClothes(player, 8, 59, 0);
                            API.setPlayerClothes(player, 11, 57, 0);
                            objplayer.IsJobDuty = true;
                        }
                        else
                        {
                            objplayer.IsJobDuty = false;
                            if (objplayer.pendingpaye > 0)
                            {
                                API.sendChatMessageToPlayer(player, "Merci pour ton travail, tu reçevra ton argent sur ta prochaine paye!");
                            }
                            Connexion lv = new Connexion();
                            lv.LoadVetements(player);
                            lv.LoadAccessoires(player);
                            return;
                        }
                    }
                    else
                    {
                        API.sendChatMessageToPlayer(player, "~r~Tu ne fais pas partie ~s~de ce job, fais toi d'abord recruter. ~m~(/rejoindreeboueur)");
                    }
                }

                //Menu Auto-Ecole
                if (!player.isInVehicle && player.position.DistanceTo(new Vector3(-139.1808, -631.9503, 168.8204)) < 2)
                {
                    API.triggerClientEvent(player, "MenuAutoEcole");
                    return;
                }

                //Menu Armurerie
                if (police.isArmurerieLSPD(player))
                {
                    if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
                    {
                        return;
                    }
                    if (objplayer.IsFactionDuty == true)
                    {
                        API.triggerClientEvent(player, "MenuArmurerieLSPD");
                    }
                    else
                    {
                        API.sendChatMessageToPlayer(player, Constante.PasEnService);
                    }
                    return;
                }

                //menu cellule
                if (police.isCellule(player))
                {
                    if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
                    {
                        return;
                    }
                    if (objplayer.IsFactionDuty == true)
                    {
                        API.triggerClientEvent(player, "MenuCelluleLSPD");
                    }
                    else
                    {
                        API.sendChatMessageToPlayer(player, Constante.PasEnService);
                    }
                    return;
                }

                //Menu Distrib
                if (police.isDistrib(player))
                {
                    API.triggerClientEvent(player, "MenuDistrib");
                    return;
                }

                //Menu Service
                if (police.isService(player))
                {
                    if (Fonction.IsPlayerInFaction(objplayer, "Police", true))
                    {
                        API.triggerClientEvent(player, "MenuService");
                    }
                    return;
                }

                //Menu Armurerie civile
                if (Fonction.isArmurerieCivil(player))
                {
                    API.triggerClientEvent(player, "MenuArmurerieCivil");
                    return;
                }

                //Menu ATM
                if (ATMInfo.GetATMInfoClosePos(player.position, 2) != null)
                {
                    if (Fonction.IsPlayerInFaction(objplayer, "Gardien", false) && objplayer.IsJobDuty == true)
                    {
                        objplayer.sacbanque = false;
                        API.setPlayerClothes(player, 5, 0, 0);
                    }
                    else
                    {
                        API.triggerClientEvent(player, "showATM");
                        objplayer.IdATM = ATMInfo.GetATMInfoClosePos(player.position, 2).ID;
                        API.setEntitySyncedData(player, "SoldeCompte", objplayer.bank);
                    }
                    return;
                }

                //Menu Banque
                if (BanqueInfo.GetBanqueInfoClosePos(player.position, 1) != null)
                {
                    API.triggerClientEvent(player, "MenuBanque");
                    objplayer.IdBanque = BanqueInfo.GetBanqueInfoClosePos(player.position, 1).ID;
                    return;
                }

                //Menu Magasin
                if (Magasin.isMagasin(player))
                {
                    API.triggerClientEvent(player, "MenuMagasin");
                    return;
                }

                //Menu Revendeur
                if (Magasin.isRevendeur(player))
                {
                    API.triggerClientEvent(player, "MenuRevendeur");
                    return;
                }

                //Menu Logement
                if (Logement.IsLogement(player))
                {
                    if (Logement.HasProprietaire(player, Logement.GetLogementIDProche(player)))
                    {
                        if (Logement.PlayerHaveKeyHouse(player, Logement.GetLogementIDProche(player)))
                        {
                            API.triggerClientEvent(player, "MenuMaisonAchetéeProprio");
                        }
                        else
                        {
                            API.triggerClientEvent(player, "MenuMaisonAchetéeNonProprio");
                        }
                    }
                    else
                    {
                        API.triggerClientEvent(player, "MenuMaisonAVendre");
                    }
                    return;
                }

                //Entrée Planque
                if (CommandesFaction.IsEntreePlanque(player) && objplayer.dimension == 0)
                {
                    System.Data.DataTable result = API.shared.exported.database.executeQueryWithResult("SELECT * FROM PlanqueFaction");
                    if (result.Rows.Count != 0)
                    {
                        foreach (System.Data.DataRow row in result.Rows)
                        {
                            String nominte        = Convert.ToString(row["nominte"]);
                            int    PorteOuverture = Convert.ToInt32(row["locked"]);
                            if (PorteOuverture == 1)
                            {
                                API.shared.sendNotificationToPlayer(player, "La porte est fermée.");
                            }
                            else
                            {
                                if (nominte == "InteArmes")
                                {
                                    API.shared.setEntityPosition(player, CommandesFaction.InteArmes);
                                    objplayer.IsOnInt          = true;
                                    objplayer.IsOnPlanqueArmes = true;
                                    API.shared.setEntityDimension(player, Convert.ToInt32(row["ID"]));
                                    objplayer.dimension = Convert.ToInt32(row["ID"]);
                                    return;
                                }
                                if (nominte == "InteDrogues")
                                {
                                    //API.shared.setEntityPosition(player, InteDrogues);
                                    API.shared.sendChatMessageToPlayer(player, "En maintenance.");
                                    objplayer.IsOnInt          = true;
                                    objplayer.IsOnPlanqueArmes = true;
                                    API.shared.setEntityDimension(player, Convert.ToInt32(row["ID"]));
                                    objplayer.dimension = Convert.ToInt32(row["ID"]);
                                    return;
                                }
                            }
                        }
                    }
                }

                //Sortie Planque
                if (CommandesFaction.IsSortiePlanque(player) && objplayer.dimension != 0)
                {
                    System.Data.DataTable result = API.shared.exported.database.executeQueryWithResult("SELECT * FROM PlanqueFaction");
                    if (result.Rows.Count != 0)
                    {
                        foreach (System.Data.DataRow row in result.Rows)
                        {
                            objplayer.IsOnInt = false;
                            API.shared.setEntityDimension(player, 0);
                            objplayer.dimension = 0;
                            Vector3 logpos = new Vector3(float.Parse(String.Format("" + row["PosX"])), float.Parse(String.Format("" + row["PosY"])), float.Parse(String.Format("" + row["PosZ"])));
                            API.shared.setEntityPosition(player, logpos);
                            objplayer.IsOnPlanqueArmes = false;
                            return;
                        }
                    }
                }

                //Menu hackeur
                if (Hackeur.isRepairePNJ(player))
                {
                    API.triggerClientEvent(player, "MenuPNJHackeur");
                    return;
                }
                if (API.getEntityData(player, "OrdiHack") == true)
                {
                    API.triggerClientEvent(player, "MenuHackeur");
                    return;
                }
                if (Hackeur.isRepaireDehors(player))
                {
                    API.setEntityPosition(player, new Vector3(1274.184, -1719.719, 54.77145));
                    return;
                }
                if (Hackeur.isRepaireDedans(player))
                {
                    API.setEntityPosition(player, new Vector3(882.7369, -1052.517, 33.00666));
                    return;
                }

                //menu exte veh
                if (!player.isInVehicle)
                {
                    VehiculeInfo objveh = VehiculeInfo.GetVehicleArroundPlayer(player);
                    if (objveh != null)
                    {
                        API.triggerClientEvent(player, "MenuExteVeh");
                    }
                    return;
                }

                //menu veh eboueur
                if (player.position.DistanceTo(Constante.Pos_CamionEboueur) < 2)
                {
                    if (objplayer.jobid == Constante.Job_Eboueur)
                    {
                        if (objplayer.IsJobDuty == true)
                        {
                            API.triggerClientEvent(player, "MenuVehEboueur");
                        }
                        else
                        {
                            API.sendChatMessageToPlayer(player, "Tu n'es pas en service.");
                        }
                    }
                    else
                    {
                        API.sendChatMessageToPlayer(player, "Tu n'es pas éboueur.");
                    }
                    return;
                }
                break;

                #endregion
                #region Bouton F1
            case "Bouton.F1":
                //menu inte veh
                if (player.isInVehicle == true)
                {
                    if (player.isInVehicle == true)
                    {
                        API.triggerClientEvent(player, "MenuInteVeh");
                    }
                    return;
                }
                break;

                #endregion
                #region Bouton F2
            case "Bouton.F2":
                //menu Unite LSPD
                if (objplayer.factionid == Constante.Faction_Police && UnitesLSPDInfo.GetUniteLSPDInfoByMembre(player) != null)
                {
                    API.triggerClientEvent(player, "MenuUniteLSPD");
                    return;
                }
                break;

                #endregion
                #region Bouton R
            case "Bouton.R":
                //event rechargement
                if (Inventaire.GetItemNumberInBDD(player, 11) != 0)
                {
                    API.triggerClientEvent(player, "RechargementPistol");
                }
                if (Inventaire.GetItemNumberInBDD(player, 12) != 0)
                {
                    API.triggerClientEvent(player, "RechargementSMG");
                }
                if (Inventaire.GetItemNumberInBDD(player, 13) != 0)
                {
                    API.triggerClientEvent(player, "RechargementRifle");
                }
                if (Inventaire.GetItemNumberInBDD(player, 14) != 0)
                {
                    API.triggerClientEvent(player, "RechargementPompe");
                }
                break;
                #endregion
            }
        }
コード例 #30
0
        public static void SetVehSpawnPoint(NetHandle vehicule, Vector3 Pos, Vector3 Rot)
        {
            VehiculeInfo objveh = VehiculeInfo.GetVehicleInfoByNetHandle(vehicule);

            API.shared.exported.database.executeQuery("UPDATE Vehicules SET PosX='" + Pos.X + "', PosY='" + Pos.Y + "', PosZ='" + Pos.Z + "', RotX='" + Rot.X + "', RotY='" + Rot.Y + "', RotZ= '" + Rot.Z + "' WHERE ID = '" + objveh.dbid + "'");
        }