Exemple #1
0
        public void BaliseCoupee(Client player)
        {
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);

            if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
            {
                return;
            }
            objplayer.BaliseLSPD = false;
            List <Client> PlayerDuty = new List <Client>();

            foreach (Client target in API.getAllPlayers())
            {
                PlayerInfo objtarget = PlayerInfo.GetPlayerInfoObject(target);
                if (objtarget.factionid == Constante.Faction_Police && objtarget.IsFactionDuty == true)
                {
                    PlayerDuty.Add(target);
                    var msgreceveur = Fonction.RemoveUnderscore(player.name) + " dit: Demande de renfort annulée.";
                    API.sendChatMessageToPlayer(target, Constante.RadioFaction, msgreceveur);
                }
            }
            foreach (Client TargetDuty in PlayerDuty)
            {
                System.Threading.Thread.Sleep(5000);
                API.triggerClientEvent(TargetDuty, "DeleteBaliseLSPD", String.Format("Balise{0}", player.name));
            }
            Fonction.SendCloseMessage(player, 15.0f, Constante.VioletMe, Fonction.RemoveUnderscore(player.name) + " utilise sa balise GPS.");
        }
Exemple #2
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);
            }
        }
Exemple #3
0
        public void Balise(Client player)
        {
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);

            if (!Fonction.IsPlayerInFaction(objplayer, "Police", true))
            {
                return;
            }
            objplayer.BaliseLSPD = true;
            List <PlayerInfo> Joueurs     = PlayerInfo.PlayerList;
            List <Client>     JoueursDuty = new List <Client>();

            foreach (PlayerInfo joueur in Joueurs)
            {
                if (joueur.factionid == Constante.Faction_Police && joueur.IsFactionDuty == true)
                {
                    JoueursDuty.Add(joueur.Handle);
                    var msgreceveur = Fonction.RemoveUnderscore(player.name) + " dit: Besoin de renfort sur notre balise GPS.";
                    API.sendChatMessageToPlayer(joueur.Handle, Constante.RadioFaction, msgreceveur);
                }
            }
            Fonction.SendCloseMessage(player, 15.0f, Constante.VioletMe, Fonction.RemoveUnderscore(player.name) + " utilise sa balise GPS.");
            foreach (Client TargetDuty in JoueursDuty)
            {
                API.sendChatMessageToPlayer(player, "test 1");
                API.triggerClientEvent(player, "BaliseLSPD", player.position.X, player.position.Y, player.position.Z, String.Format("Balise{0}", player.name));
            }
            while (objplayer.BaliseLSPD == true)
            {
                System.Threading.Thread.Sleep(2000);
                foreach (Client TargetDuty in JoueursDuty)
                {
                    API.sendChatMessageToPlayer(player, "test 2");
                    API.triggerClientEvent(TargetDuty, "DeleteBaliseLSPD", String.Format("Balise{0}", player.name));
                    API.triggerClientEvent(player, "BaliseLSPD", player.position.X, player.position.Y, player.position.Z, String.Format("Balise{0}", player.name));
                }
            }
        }
Exemple #4
0
        public void OnPlayerChat(Client player, string message, CancelEventArgs e)
        {
            API.exported.database.executeQuery("INSERT INTO LogTextJoueur VALUE ('', 'Message', '" + player.name + "', '" + message + "')");
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);

            if (objplayer.EnAppel == true)
            {
                API.sendChatMessageToPlayer(objplayer.Correspondant, "~b~Téléphone~s~: " + message);
            }
            Fonction.SendCloseMessage(player, 15.0f, "~#ffffff~", Fonction.RemoveUnderscore(player.name) + " dit: " + message);
            if (objplayer.addquestion == 1)
            {
                API.exported.database.executeQuery("INSERT INTO QuestionAutoEcole VALUES ('','" + message + "', '', '', '')");
                DataTable result = API.exported.database.executeQueryWithResult("SELECT * FROM QuestionAutoEcole WHERE Question='" + message + "'");
                foreach (DataRow row in result.Rows)
                {
                    objplayer.IDBDDquestion = Convert.ToInt32(row["ID"]);
                    objplayer.addquestion   = 2;
                    API.sendChatMessageToPlayer(player, "[2/4] Entre maintenant la bonne réponse.");
                    e.Cancel = true;
                    return;
                }
            }
            if (objplayer.addquestion == 2)
            {
                API.exported.database.executeQuery("UPDATE QuestionAutoEcole SET BR='" + message + "' WHERE ID='" + objplayer.IDBDDquestion + "'");
                API.sendChatMessageToPlayer(player, "[3/4] Entre maintenant une mauvaise réponse.");
                objplayer.addquestion = 3;
                e.Cancel = true;
                return;
            }
            if (objplayer.addquestion == 3)
            {
                API.exported.database.executeQuery("UPDATE QuestionAutoEcole SET R2='" + message + "' WHERE ID='" + objplayer.IDBDDquestion + "'");
                API.sendChatMessageToPlayer(player, "[4/4] Entre maintenant une autre mauvaise réponse.");
                objplayer.addquestion = 4;
                e.Cancel = true;
                return;
            }
            if (objplayer.addquestion == 4)
            {
                API.exported.database.executeQuery("UPDATE QuestionAutoEcole SET R3='" + message + "' WHERE ID='" + objplayer.IDBDDquestion + "'");
                API.sendChatMessageToPlayer(player, "La question a bien été ajoutée.");
                objplayer.addquestion = 0;
                e.Cancel = true;
                return;
            }
            if (objplayer.DansQuestionnaire == true)
            {
                if (message == Convert.ToString(objplayer.BonneReponse))
                {
                    if (objplayer.QuestionEnCours != objplayer.OrdreQuestionAutoEcole.Count)
                    {
                        objplayer.QuestionEnCours += 1;
                        if (objplayer.QuestionEnCours != objplayer.OrdreQuestionAutoEcole.Count)
                        {
                            for (int p = 0; p < 10; p++)
                            {
                                API.sendChatMessageToPlayer(player, " ");
                            }
                            AutoEcole.LoadQuestion(player);
                            e.Cancel = true;
                            return;
                        }
                        else
                        {
                            for (int p = 0; p < 10; p++)
                            {
                                API.sendChatMessageToPlayer(player, " ");
                            }
                            API.sendChatMessageToPlayer(player, "~g~Félicitation~s~, tu as ~g~réussi~s~ l'épreuve du ~b~code de la route~s~ !");
                            API.sendChatMessageToPlayer(player, "Tu peux maintenant ~g~passer~s~ l'épreuve de ~b~conduite~s~.");
                            objplayer.DansQuestionnaire = false;
                            objplayer.CodeDeLaRoute     = true;
                            objplayer.OrdreQuestionAutoEcole.Clear();
                        }
                    }
                }
            }
            e.Cancel = true;
            return;
        }
Exemple #5
0
 [Command("s", GreedyArg = true)] //crier
 public void Command_s(Client player, string message)
 {
     Fonction.SendCloseMessage(player, 25.0f, "~#ffffff~", Fonction.RemoveUnderscore(player.name) + " crie: " + message + "!");
 }
Exemple #6
0
 [Command("chu", GreedyArg = true)] //chuchotter
 public void Command_chu(Client player, string message)
 {
     Fonction.SendCloseMessage(player, 7.5f, "~#ffffff~", Fonction.RemoveUnderscore(player.name) + " chuchotte: " + message);
 }
Exemple #7
0
 [Command("o", GreedyArg = true)] //ooc
 public void Command_o(Client player, string message)
 {
     Fonction.SendCloseMessage(player, 15.0f, "~#ffffff~", Fonction.RemoveUnderscore(player.name) + " dit: " + "(( " + message + " ))");
 }
Exemple #8
0
 public void Command_do(Client player, string action)
 {
     Fonction.SendCloseMessage(player, 15.0f, Constante.VioletMe, action + " " + "((" + Fonction.RemoveUnderscore(player.name) + "))");
 }
Exemple #9
0
 [Command("melow", GreedyArg = true)] // /me avec petit radius
 public void Command_melow(Client player, string action)
 {
     Fonction.SendCloseMessage(player, 7.5f, Constante.VioletMe, Fonction.RemoveUnderscore(player.name) + " " + action);
 }