Пример #1
0
        public void CMD_BurnMoney(Client client, double amount)
        {
            if (!client.HasData("ID"))
            {
                return;
            }

            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);

            if (playerInfo == null)
            {
                return;
            }

            bool result = playerInfo.SubMoney(amount);

            Database.Update(playerInfo);

            if (!result)
            {
                return;
            }

            client.SendNotification($"~g~tu as jeté {amount}$ !");
            EventTriggers.Update_Money(client);
        }
Пример #2
0
        public void RentSpawnCarRoller(Client client)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(client);

            if (client.HasData("RentVehicle"))
            {
                client.SendNotification("~y~Du besitzt bereits einen Mietvertrag!");
                client.SendChatMessage("~r~Mietfahrzeug:~w~ Nutze /unrent um deinen Mietvertrag zu kündigen!");
                return;
            }

            uint rveh = NAPI.Util.GetHashKey("faggio2");

            Vehicle veh = NAPI.Vehicle.CreateVehicle(rveh, new Vector3(-1151.06201171875, -716.578186035156, 20.6585292816162), 311.515930175781f, 0, 0);

            NAPI.Vehicle.SetVehicleNumberPlate(veh, client.Name);
            client.SetIntoVehicle(veh, -1);
            veh.Locked = true;

            client.SendChatMessage("~r~Mietfahrzeug:~w~ /lock - Abschliessen & Aufschliessen.");
            client.SendChatMessage("~r~Mietfahrzeug:~w~/motor - Motor starten/abschalten.");

            pInfo.SubMoney(150);
            Database.Update(pInfo);

            EventTriggers.Update_Money(client);

            client.SendNotification("Du hast ~g~150$~w~ für dein Mietfahrzeug gezahlt.");

            client.SetData("RentVehicle", veh);
        }
Пример #3
0
        public void RentSpawnCarRoller2(Client client)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(client);

            if (client.HasData("RentVehicle"))
            {
                client.SendNotification("~y~Vous avez déjà loué un véhicule !");
                client.SendChatMessage("~r~Avertissement:~w~ Faite /unrent pour résilier la location !");
                return;
            }

            uint rveh = NAPI.Util.GetHashKey("blista2");

            Vehicle veh = NAPI.Vehicle.CreateVehicle(rveh, new Vector3(-1151.06201171875, -716.578186035156, 20.6585292816162), 311.515930175781f, 0, 0);

            NAPI.Vehicle.SetVehicleNumberPlate(veh, client.Name);
            client.SetIntoVehicle(veh, -1);
            veh.Locked = true;

            client.SendChatMessage("~r~Avertissement::~w~ /lock - Pour bloquer/débloquer votre véhicule");
            client.SendChatMessage("~r~Avertissement:~w~ /motor - Pour démarrer le moteur");

            pInfo.SubMoney(150);
            Database.Update(pInfo);

            EventTriggers.Update_Money(client);

            client.SendNotification("Vous avez payez ~g~150$~w~ pour la location.");

            client.SetData("RentVehicle", veh);
            isMenuOpen = false;
        }
Пример #4
0
        public void OnPlayerBuyVehicle1(Client client)
        {
            int client_id = client.GetData("ID");

            PlayerInfo     pInfo = PlayerHelper.GetPlayerStats(client);
            PlayerVehicles pVeh  = PlayerHelper.GetpVehiclesStats(client);

            if (client.HasData("PersonalVehicle"))
            {
                client.SendChatMessage("Du besitzt bereits zu viele Fahrzeuge!");
                return;
            }

            if (pInfo.money >= 12500)
            {
                uint    hash = NAPI.Util.GetHashKey("issi2");
                Vehicle veh  = NAPI.Vehicle.CreateVehicle(hash, new Vector3(-21.45006, -1676.862, 29.16188), 108.823f, 0, 0);
                NAPI.Vehicle.SetVehicleNumberPlate(veh, client.Name);
                client.SetIntoVehicle(veh, -1);

                veh.Locked         = true;
                pVeh               = new PlayerVehicles();
                pVeh._id           = client_id;
                pVeh.carslot      += 1;
                pVeh.carmodel      = "issi2";
                pVeh.last_location = new double[] { veh.Position.X, veh.Position.Y, veh.Position.Z };
                pVeh.last_rotation = veh.Rotation.Z;


                //TUNES
                pVeh.Color1 = 0; pVeh.Color2 = 0; pVeh.spoilers = -1; pVeh.fbumber = -1; pVeh.rbumber = -1; pVeh.sskirt = -1; pVeh.exhaust = -1; pVeh.frame = -1;
                pVeh.grill  = -1; pVeh.roof = -1; pVeh.motortuning = -1; pVeh.brakes = -1; pVeh.transmission = -1; pVeh.turbo = -1; pVeh.fwheels = -1; pVeh.bwheels = -1;
                pVeh.window = -1; pVeh.suspension = -1;

                NAPI.Vehicle.SetVehiclePrimaryColor(veh, pVeh.Color1); NAPI.Vehicle.SetVehicleSecondaryColor(veh, pVeh.Color2); NAPI.Vehicle.SetVehicleMod(veh, 0, pVeh.spoilers);
                NAPI.Vehicle.SetVehicleMod(veh, 1, pVeh.fbumber); NAPI.Vehicle.SetVehicleMod(veh, 2, pVeh.rbumber); NAPI.Vehicle.SetVehicleMod(veh, 3, pVeh.sskirt);
                NAPI.Vehicle.SetVehicleMod(veh, 4, pVeh.exhaust); NAPI.Vehicle.SetVehicleMod(veh, 5, pVeh.frame); NAPI.Vehicle.SetVehicleMod(veh, 6, pVeh.grill); NAPI.Vehicle.SetVehicleMod(veh, 10, pVeh.roof);
                NAPI.Vehicle.SetVehicleMod(veh, 11, pVeh.motortuning); NAPI.Vehicle.SetVehicleMod(veh, 12, pVeh.brakes); NAPI.Vehicle.SetVehicleMod(veh, 13, pVeh.transmission);
                NAPI.Vehicle.SetVehicleMod(veh, 18, pVeh.turbo); NAPI.Vehicle.SetVehicleMod(veh, 23, pVeh.fwheels); NAPI.Vehicle.SetVehicleMod(veh, 24, pVeh.bwheels); //MOTORAD
                NAPI.Vehicle.SetVehicleWindowTint(veh, pVeh.window); NAPI.Vehicle.SetVehicleMod(veh, 15, pVeh.suspension);

                client.SetData("PersonalVehicle", veh);

                pInfo.SubMoney(12500);
                Database.Update(pInfo);
                Database.Upsert(pVeh);

                EventTriggers.Update_Money(client);
            }
            else
            {
                client.SendChatMessage("[~y~Autohaus~w~] Du hast nicht genügend Bargeld bei dir!");
            }
        }
Пример #5
0
        public void CMD_GiveMoney(Client client, Client player, double amount)
        {
            if (!client.HasData("ID"))
            {
                return;
            }

            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);
            PlayerInfo pInfo      = PlayerHelper.GetPlayerStats(player);

            if (pInfo == null)
            {
                client.SendNotification($"Le joueur {player.Name} n'a pas pu être trouvé.");
                return;
            }


            PlayerInfo otherInfo = Database.GetById <PlayerInfo>(pInfo._id);

            if (otherInfo == null)
            {
                Console.WriteLine($"{pInfo.vorname} {pInfo.nachname} n'a pas de table PlayerInfo!");
                return;
            }

            bool result = playerInfo.SubMoney(amount);

            if (!result)
            {
                client.SendNotification("~r~Vous ne possédez pas cet argent!");
                return;
            }

            otherInfo.AddMoney(amount);

            Database.Update(otherInfo);
            Database.Update(playerInfo);

            client.SendNotification($"Vous avez donné au joueur { player.Name} ~g~{amount}$ ~w~avec succes!");
            player.SendNotification($"Vous avez reçu ~g~{amount}~w~ de {client.Name} !");
            EventTriggers.Update_Money(client);

            Client other_player = NAPI.Player.GetPlayerFromName(player.Name);

            if (other_player == null)
            {
                return;
            }

            EventTriggers.Update_Money(other_player);
        }
Пример #6
0
        public void CMD_GiveMoney(Client client, Client player, double amount)
        {
            if (!client.HasData("ID"))
            {
                return;
            }

            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);
            PlayerInfo pInfo      = PlayerHelper.GetPlayerStats(player);

            if (pInfo == null)
            {
                client.SendNotification($"Spieler {player.Name} konnte nicht gefunden werden.");
                return;
            }


            PlayerInfo otherInfo = Database.GetById <PlayerInfo>(pInfo._id);

            if (otherInfo == null)
            {
                Console.WriteLine($"{pInfo.vorname} {pInfo.nachname} besitzt keine PlayerInfo Tabelle!");
                return;
            }

            bool result = playerInfo.SubMoney(amount);

            if (!result)
            {
                client.SendNotification("~r~Dieses Geld besitzt du nicht!");
                return;
            }

            otherInfo.AddMoney(amount);

            Database.Update(otherInfo);
            Database.Update(playerInfo);

            client.SendNotification($"Du hast dem Spieler {player.Name} erfolgreich ~g~{amount}$ ~w~gegeben!");
            player.SendNotification($"Du hast ~g~{amount}~w~ von {client.Name} erhalten!");
            EventTriggers.Update_Money(client);

            Client other_player = NAPI.Player.GetPlayerFromName(player.Name);

            if (other_player == null)
            {
                return;
            }

            EventTriggers.Update_Money(other_player);
        }
Пример #7
0
        public void CMD_Money(Client client)
        {
            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);

            if (playerInfo == null)
            {
                Console.WriteLine("Les statistiques des joueurs sont introuvables.");
                return;
            }

            client.SendNotification($"Votre solde est de: ~g~{playerInfo.money}$");
            client.SendNotification($"Votre solde bancaire est de: ~g~{playerInfo.bank}$");

            EventTriggers.Update_Money(client);
        }
Пример #8
0
        public void CMD_Money(Client client)
        {
            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);

            if (playerInfo == null)
            {
                Console.WriteLine("Spieler Statistiken konnten nicht gefunden werden.");
                return;
            }

            client.SendNotification($"Dein Guthaben beträgt: ~g~{playerInfo.money}$");
            client.SendNotification($"Dein Bankguthaben beträgt: ~g~{playerInfo.bank}$");

            EventTriggers.Update_Money(client);
        }
Пример #9
0
        public static void FinishLogin(Client client)
        {
            int client_id = client.GetData("ID");

            PlayerInfo     playerInfo = PlayerHelper.GetPlayerStats(client);
            PlayerVehicles pVeh       = PlayerHelper.GetpVehiclesStats(client);

            //Database.Update(playerInfo);
            playerInfo.Update();

            EventTriggers.Update_Money(client);
            EventTriggers.Update_Bank(client);
            EventTriggers.Update_Wanteds(client);

            NAPI.Player.SetPlayerName(client, playerInfo.vorname + "" + playerInfo.nachname);

            if (playerInfo.wantedlevel >= 1)
            {
                NAPI.Player.SetPlayerNametagColor(client, 249, 27, 27);
            }

            if (playerInfo.temp_location == null)
            {
                client.Position = playerInfo.GetLastPlayerLocation();
            }
            else
            {
                client.Position = playerInfo.GetLastTempLocation();
                client.SendChatMessage("~r~Du sitzt noch " + playerInfo.jailtime);
                client.Freeze(true);
            }

            if (playerInfo.cuff == 1)
            {
                client.SendChatMessage("~r~Du hast Offlineflucht begangen und sitzt nun 10 Minuten länger im Gefängnis!");
                playerInfo.cuff = 0;
                playerInfo.Update();
            }

            PlayerData.ResetClothes(client);

            PlayerVehicles.GetLastCarPosition(client);
            //client.SendNotification("~g~Erfolgreich eingeloggt!");

            NAPI.ClientEvent.TriggerClientEvent(client, "LoginUnFreeze");
            NAPI.ClientEvent.TriggerClientEvent(client, "CameraDestroy");
            return;
        }
Пример #10
0
        public void CMD_UnRent(Client client)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(client);

            Vehicle rent = client.GetData("RentVehicle");

            if (client.HasData("RentVehicle"))
            {
                if (client.IsInVehicle)
                {
                    if (client.Position.DistanceTo2D(rent.Position) <= 0.1)
                    {
                        if (NAPI.Vehicle.GetVehicleHealth(client) >= 800)
                        {
                            Vehicle RentVehicle = client.GetData("RentVehicle");
                            RentVehicle.Delete();
                            client.SendChatMessage("Dein Mietvertrag wurde gekündigt. Du erhälst ~g~75$~w~ zurück!");
                            client.SendNotification("Du hast ~g~75$~w~ erhalten.");
                            client.ResetData("RentVehicle");
                            pInfo.AddMoney(75);
                            Database.Update(pInfo);
                            EventTriggers.Update_Money(client);
                        }
                        else if (NAPI.Vehicle.GetVehicleHealth(client) <= 800)
                        {
                            Vehicle RentVehicle = client.GetData("RentVehicle");
                            RentVehicle.Delete();
                            client.SendChatMessage("Dein Fahrzeug hat zu viele beschädigungen. Du erhälst kein Geld zurück!");
                            client.ResetData("RentVehicle");
                        }
                    }
                    else
                    {
                        client.SendNotification("Du befindest dich nicht auf dem Roller!");
                    }
                }
                else
                {
                    client.SendNotification("Du befindest dich nicht auf dem Roller!");
                }
            }
            else //if (client.HasData("RentVehicle") == false)
            {
                client.SendNotification("~r~Du besitzt kein Mietfahrzeug!");
            }
        }
Пример #11
0
        public void OnPlayerBuyVehicle1(Client client)
        {
            int client_id = client.GetData("ID");

            PlayerInfo     pInfo = PlayerHelper.GetPlayerStats(client);
            PlayerVehicles pVeh  = PlayerHelper.GetpVehiclesStats(client);

            if (client.HasData("PersonalVehicle"))
            {
                client.SendChatMessage("Du besitzt bereits zu viele Fahrzeuge!");
                return;
            }

            if (pInfo.money >= 12500)
            {
                uint    hash = NAPI.Util.GetHashKey("issi2");
                Vehicle veh  = NAPI.Vehicle.CreateVehicle(hash, new Vector3(-21.45006, -1676.862, 29.16188), 108.823f, 0, 0);
                NAPI.Vehicle.SetVehicleNumberPlate(veh, client.Name);
                client.SetIntoVehicle(veh, -1);

                veh.Locked         = true;
                pVeh               = new PlayerVehicles();
                pVeh._id           = client_id;
                pVeh.carslot      += 1;
                pVeh.carmodel      = "issi2";
                pVeh.last_location = new double[] { veh.Position.X, veh.Position.Y, veh.Position.Z };
                pVeh.last_rotation = veh.Rotation.Z;

                LoadTunes(client, veh, pVeh);

                client.SetData("PersonalVehicle", veh);
                veh.SetData("ID", client_id);

                pInfo.SubMoney(12500);
                Database.Update(pInfo);
                Database.Upsert(pVeh);

                EventTriggers.Update_Money(client);
            }
            else
            {
                client.SendChatMessage("[~y~Autohaus~w~] Du hast nicht genügend Bargeld bei dir!");
            }
        }
Пример #12
0
        public static void FinishLogin(Client client)
        {
            int client_id = client.GetData("ID");

            PlayerInfo     playerInfo    = PlayerHelper.GetPlayerStats(client);
            PlayerClothes  playerClothes = PlayerHelper.GetPlayerClothes(client);
            PlayerVehicles pVeh          = PlayerHelper.GetpVehiclesStats(client);

            //Database.Update(playerInfo);
            playerInfo.Update();

            EventTriggers.Update_Money(client);
            EventTriggers.Update_Bank(client);
            EventTriggers.Update_Wanteds(client);

            NAPI.Player.SetPlayerName(client, playerInfo.vorname + "" + playerInfo.nachname);

            if (playerInfo.wantedlevel >= 1)
            {
                NAPI.Player.SetPlayerNametagColor(client, 249, 27, 27);
            }

            if (playerInfo.cuff == 1)
            {
                client.SendNotification("~r~Suite à l'évasion tentée, vous recevez 5 minutes de prison supplémentaires.");
                playerInfo.jailtime += 300000;
                playerInfo.cuff      = 0;
                playerInfo.jail      = 1;
                playerInfo.Update();
            }

            PlayerVehicles.GetLastCarPosition(client);
            //client.SendNotification("~g~Erfolgreich eingeloggt!");

            NAPI.ClientEvent.TriggerClientEvent(client, "LoginUnFreeze");
            NAPI.ClientEvent.TriggerClientEvent(client, "CameraDestroy");

            PlayerData.Respawn(client);
            return;
        }
Пример #13
0
        public void OnPlayerEinzahlung(Client client, int summe)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(client);

            if (pInfo.money < summe)
            {
                client.SendChatMessage("~r~Vous n'avez pas assez d'argent!");
                client.TriggerEvent("BankResult", 0);
                return;
            }
            else
            {
                pInfo.money -= summe;
                pInfo.bank  += summe;
                client.SendChatMessage($"~w~Vous avez déposé ~g~${summe} ~w~sur votre compte");
                client.SendChatMessage($"~w~Nouveau solde du compte ~g~${pInfo.bank}~w~ | trésorerie: ~g~${pInfo.money}");
                client.TriggerEvent("BankResult", 1);
                Database.Upsert(pInfo);

                EventTriggers.Update_Money(client);
                EventTriggers.Update_Bank(client);
            }
        }
Пример #14
0
        public void OnPlayerEinzahlung(Client client, int summe)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(client);

            if (pInfo.money < summe)
            {
                client.SendChatMessage("~r~Du hast nicht genung Bargeld!");
                client.TriggerEvent("BankResult", 0);
                return;
            }
            else
            {
                pInfo.money -= summe;
                pInfo.bank  += summe;
                client.SendChatMessage($"~w~Du hast ~g~${summe} ~w~auf dein Konto eingezahlt!");
                client.SendChatMessage($"~w~Neuer Kontostand: ~g~${pInfo.bank}~w~ | Bargeld: ~g~${pInfo.money}");
                client.TriggerEvent("BankResult", 1);
                Database.Upsert(pInfo);

                EventTriggers.Update_Money(client);
                EventTriggers.Update_Bank(client);
            }
        }
Пример #15
0
        public void CMD_setmoney(Client client, Client player, double amount)
        {
            if (!client.HasData("ID"))
            {
                return;
            }

            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);
            PlayerInfo pInfo      = PlayerHelper.GetPlayerStats(player);

            if (!AdminSystem.HasRank(client, 2))
            {
                client.SendNotification("~r~Vous n'avez aucune autorisation!");
                return;
            }

            client.SendNotification($"Vous avez donné à ~y~{player.Name}~w~  ~g~{amount}$~w~ $!");
            player.SendNotification($"Vous avez obtenu ~g~{amount}$~w~ ");

            pInfo.AddMoney(amount);

            Database.Update(pInfo);
            EventTriggers.Update_Money(player);
        }
Пример #16
0
        public void CMD_setmoney(Client client, Client player, double amount)
        {
            if (!client.HasData("ID"))
            {
                return;
            }

            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);
            PlayerInfo pInfo      = PlayerHelper.GetPlayerStats(player);

            if (!AdminSystem.HasRank(client, 2))
            {
                client.SendNotification("~r~Du hast dazu keine Berechtigung!");
                return;
            }

            client.SendNotification($"Du hast dem Spieler ~y~{player.Name}~w~ erfolgreich ~g~{amount}$~w~ gegeben!");
            player.SendNotification($"Du hast ~g~{amount}$~w~ erhalten!");

            pInfo.AddMoney(amount);

            Database.Update(pInfo);
            EventTriggers.Update_Money(player);
        }
Пример #17
0
        public static void Respawn(Client client)
        {
            PlayerClothes playerClothes = PlayerHelper.GetPlayerClothes(client);
            PlayerInfo    playerInfo    = PlayerHelper.GetPlayerStats(client);

            if (playerClothes == null)
            {
                playerClothes     = new PlayerClothes();
                playerClothes._id = playerInfo._id;
                playerClothes.Upsert();
            }

            client.SetClothes(1, playerClothes.clothes_1, 0);
            client.SetClothes(2, playerClothes.clothes_2, 0);
            client.SetClothes(3, playerClothes.clothes_3, 0);
            client.SetClothes(4, playerClothes.clothes_4, 0);
            client.SetClothes(5, playerClothes.clothes_5, 0);
            client.SetClothes(6, playerClothes.clothes_6, 0);
            client.SetClothes(7, playerClothes.clothes_7, 0);
            client.SetClothes(8, playerClothes.clothes_8, 0);
            client.SetClothes(9, playerClothes.clothes_9, 0);
            client.SetClothes(10, playerClothes.clothes_10, 0);
            client.SetClothes(11, playerClothes.clothes_11, 0);

            if (client.HasData("FrakVehicle"))
            {
                Vehicle previous_vehicle = client.GetData("FrakVehicle");
                previous_vehicle.Delete();
                client.ResetData("FrakVehicle");
                client.SendNotification("Dein Fraktionsfahrzeug wurde gelöscht!");
            }

            if (client.HasData("onduty"))
            {
                client.ResetData("onduty");
                client.SendNotification("Du bist nun nicht mehr im Dienst!");
            }

            if (client.HasData("fonduty"))
            {
                client.ResetData("fonduty");
                client.SendNotification("Du bist nun nicht mehr im Dienst!");
            }

            if (playerInfo.jail == 1)
            {
                TimeSpan ts = TimeSpan.FromMilliseconds(playerInfo.jailtime);

                client.Position = playerInfo.GetLastTempLocation();
                client.RemoveAllWeapons();

                if (playerInfo.wantedlevel == 1)
                {
                    playerInfo.jailtime += 60000;
                }
                else if (playerInfo.wantedlevel == 2)
                {
                    playerInfo.jailtime += 120000;
                }
                else if (playerInfo.wantedlevel == 3)
                {
                    playerInfo.jailtime += 180000;
                }
                else if (playerInfo.wantedlevel == 4)
                {
                    playerInfo.jailtime += 240000;
                }
                else if (playerInfo.wantedlevel == 5)
                {
                    playerInfo.jailtime += 300000;
                }
                else if (playerInfo.wantedlevel >= 6)
                {
                    playerInfo.jailtime += 360000;
                }

                playerInfo.wantedlevel = 0;
                playerInfo.cuff        = 0;
                playerInfo.Update();

                NAPI.ClientEvent.TriggerClientEvent(client, "JailTrue");
                client.SendNotification("[~b~LSPD~w~]: Bitte logge dich nicht aus sonst sitzt du wieder so lange!");

                client.SendNotification($"[~b~LSPD~w~]: Du sitzt für ~r~{ts.Minutes}~w~ Minuten.");

                NAPI.Task.Run(() =>
                {
                    NAPI.ClientEvent.TriggerClientEvent(client, "JailFalse");
                    client.SendNotification("[~b~LSPD~w~]: Du bist nun frei!");
                    playerInfo.jail     = 0;
                    playerInfo.jailtime = 0;
                    playerInfo.Update();
                    Respawn(client);
                }, delayTime: playerInfo.jailtime);
            }
            else
            {
                client.Position = playerInfo.GetLastPlayerLocation();
            }

            EventTriggers.Update_Wanteds(client);
            EventTriggers.Update_Money(client);
            EventTriggers.Update_Bank(client);

            client.SendNotification("~g~Du wurdest respawnt!");
        }
Пример #18
0
        public void CMD_Revive(Client client, Client player)
        {
            PlayerInfo cInfo = PlayerHelper.GetPlayerStats(client);
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

            if (!FraktionSystem.HasRank(client, 2))
            {
                client.SendNotification("~r~Vous n'appartenez pas à la SARU!");
                return;
            }

            if (!client.HasData("onduty"))
            {
                client.SendNotification("~r~Vous n'êtes pas en service!");
                return;
            }

            if (client.Position.DistanceTo2D(player.Position) <= 3)
            {
                if (!player.HasData("dead"))
                {
                    client.SendNotification("Ce joueur n'est pas mort!");
                    return;
                }

                NAPI.Player.SpawnPlayer(player, pInfo.GetLastPlayerLocation());
                player.SendNotification("Vous avez été réapparu!");
                NAPI.ClientEvent.TriggerClientEvent(player, "DeathFalse");
                player.ResetData("dead");

                cInfo.money += 100;
                cInfo.Update();
                client.SendNotification("[~r~SARU~w~]: Vous avez 100~g~$~w~.");

                if (pInfo.money > 100)
                {
                    pInfo.money -= 100;
                    pInfo.Update();
                    player.SendNotification("[~r~SARU~w~]: Vous avez payé 100~g~$~w~ pour le traitement..");
                }
                else if (pInfo.bank > 100)
                {
                    pInfo.bank -= 100;
                    pInfo.Update();
                    player.SendNotification("[~r~SARU~w~]: Vous avez payé 100~g~$~w~ pour le traitement.");
                } else
                {
                    client.SendNotification("[~y~EasterEgg~w~]: Tu es sacrément pauvre! Va travailler!");
                }

                EventTriggers.Update_Money(client);
                EventTriggers.Update_Bank(client);

                EventTriggers.Update_Money(player);
                EventTriggers.Update_Bank(player);

            } else
            {
                client.SendNotification("Vous n'êtes pas près de cette personne!");
            }
        }
Пример #19
0
        public static void Respawn(Client client)
        {
            PlayerClothes playerClothes = PlayerHelper.GetPlayerClothes(client);
            PlayerInfo    playerInfo    = PlayerHelper.GetPlayerStats(client);

            if (playerClothes == null)
            {
                playerClothes     = new PlayerClothes();
                playerClothes._id = playerInfo._id;
                playerClothes.Upsert();
            }

            client.SetClothes(1, playerClothes.clothes_1, 0);
            client.SetClothes(2, playerClothes.clothes_2, 0);
            client.SetClothes(3, playerClothes.clothes_3, 0);
            client.SetClothes(4, playerClothes.clothes_4, 0);
            client.SetClothes(5, playerClothes.clothes_5, 0);
            client.SetClothes(6, playerClothes.clothes_6, 0);
            client.SetClothes(7, playerClothes.clothes_7, 0);
            client.SetClothes(8, playerClothes.clothes_8, 0);
            client.SetClothes(9, playerClothes.clothes_9, 0);
            client.SetClothes(10, playerClothes.clothes_10, 0);
            client.SetClothes(11, playerClothes.clothes_11, 0);

            if (client.HasData("FrakVehicle"))
            {
                Vehicle previous_vehicle = client.GetData("FrakVehicle");
                previous_vehicle.Delete();
                client.ResetData("FrakVehicle");
                client.SendNotification("Votre véhicule de faction a été supprimé!");
            }

            if (client.HasData("onduty"))
            {
                client.ResetData("onduty");
                client.SendNotification("Vous n'êtes plus en service!");
            }

            if (client.HasData("fonduty"))
            {
                client.ResetData("fonduty");
                client.SendNotification("Vous n'êtes plus en service!");
            }

            if (playerInfo.jail == 1)
            {
                TimeSpan ts = TimeSpan.FromMilliseconds(playerInfo.jailtime);

                client.Position = playerInfo.GetLastTempLocation();
                client.RemoveAllWeapons();

                if (playerInfo.wantedlevel == 1)
                {
                    playerInfo.jailtime += 60000;
                }
                else if (playerInfo.wantedlevel == 2)
                {
                    playerInfo.jailtime += 120000;
                }
                else if (playerInfo.wantedlevel == 3)
                {
                    playerInfo.jailtime += 180000;
                }
                else if (playerInfo.wantedlevel == 4)
                {
                    playerInfo.jailtime += 240000;
                }
                else if (playerInfo.wantedlevel == 5)
                {
                    playerInfo.jailtime += 300000;
                }
                else if (playerInfo.wantedlevel >= 6)
                {
                    playerInfo.jailtime += 360000;
                }

                playerInfo.wantedlevel = 0;
                playerInfo.cuff        = 0;
                playerInfo.Update();

                NAPI.ClientEvent.TriggerClientEvent(client, "JailTrue");
                client.SendNotification("[~b~LSPD~w~]: S'il vous plaît ne vous déconnectez pas ou vous serez assis à nouveau pendant si longtemps!");

                client.SendNotification($"[~b~LSPD~w~]: Vous êtes assis pour ~r~{ts.Minutes}~w~ Minutes.");

                NAPI.Task.Run(() =>
                {
                    NAPI.ClientEvent.TriggerClientEvent(client, "JailFalse");
                    client.SendNotification("[~b~LSPD~w~]: Vous êtes libre maintenant!");
                    playerInfo.jail     = 0;
                    playerInfo.jailtime = 0;
                    playerInfo.Update();
                    Respawn(client);
                }, delayTime: playerInfo.jailtime);
            }
            else
            {
                client.Position = playerInfo.GetLastPlayerLocation();
            }

            EventTriggers.Update_Wanteds(client);
            EventTriggers.Update_Money(client);
            EventTriggers.Update_Bank(client);

            client.SendNotification("~g~Vous etes réapparu!");
        }
Пример #20
0
        public void CMD_Revive(Client client, Client player)
        {
            PlayerInfo cInfo = PlayerHelper.GetPlayerStats(client);
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

            if (!FraktionSystem.HasRank(client, 2))
            {
                client.SendNotification("~r~Du gehörst nicht zur SARU!");
                return;
            }

            if (!client.HasData("onduty"))
            {
                client.SendNotification("~r~Du bist nicht im Dienst!");
                return;
            }

            if (client.Position.DistanceTo2D(player.Position) <= 3)
            {
                if (!player.HasData("dead"))
                {
                    client.SendNotification("Dieser Spieler ist nicht gestorben!");
                    return;
                }

                NAPI.Player.SpawnPlayer(player, pInfo.GetLastPlayerLocation());
                player.SendNotification("Du wurdest respawnt!");
                NAPI.ClientEvent.TriggerClientEvent(player, "DeathFalse");
                player.ResetData("dead");

                cInfo.money += 100;
                cInfo.Update();
                client.SendNotification("[~r~SARU~w~]: Du hast 100~g~$~w~ erhalten.");

                if (pInfo.money > 100)
                {
                    pInfo.money -= 100;
                    pInfo.Update();
                    player.SendNotification("[~r~SARU~w~]: Du hast für die Behandlung 100~g~$~w~ bezahlt.");
                }
                else if (pInfo.bank > 100)
                {
                    pInfo.bank -= 100;
                    pInfo.Update();
                    player.SendNotification("[~r~SARU~w~]: Du hast für die Behandlung 100~g~$~w~ bezahlt.");
                }
                else
                {
                    client.SendNotification("[~y~EasterEgg~w~]: Du bist verdammt arm! geh arbeiten!");
                }

                EventTriggers.Update_Money(client);
                EventTriggers.Update_Bank(client);

                EventTriggers.Update_Money(player);
                EventTriggers.Update_Bank(player);
            }
            else
            {
                client.SendNotification("Du bist nicht in der Nähe dieser Person!");
            }
        }