Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
        public void CMD_SetWanted(Client client, Client player, int wanteds)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

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

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

            if (player == null)
            {
                client.SendNotification("Le joueur n'a pas été trouvé!");
                return;
            }

            if (client.Name == player.Name)
            {
                client.SendNotification("~r~Vous ne pouvez pas vous spécifier!");
                return;
            }

            if (wanteds > 6)
            {
                client.SendChatMessage("Vous ne pouvez pas distribuer plus de 6 Wanted!");
                return;
            }

            pInfo.wantedlevel += wanteds;
            client.SendNotification($"[~b~LSPD~w~]: Le joueur ~r~{player.Name}~w~ vous à donné  ~r~{wanteds} recherche~w~ !");
            player.SendChatMessage($"[~b~LSPD~w~]: ~b~{client.Name}~w~ est recherché ~r~{wanteds} ~w~ !");
            pInfo.Update();
            EventTriggers.Update_Wanteds(player);
        }
Exemplo n.º 3
0
        public void CMD_DelAkte(Client client, Client player)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

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

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

            if (player == null)
            {
                client.SendNotification("Le joueur n'a pas été trouvé!");
                return;
            }

            if (client.Name == player.Name)
            {
                client.SendNotification("~r~Vous ne pouvez pas vous spécifier!");
                return;
            }

            if (pInfo.wantedlevel > 4)
            {
                client.SendNotification("Ce joueur a trop de souhaits!");
                return;
            }

            pInfo.wantedlevel = 0;
            client.SendNotification($"[~b~LSPD~w~]: Vous avez supprimé le dossier de { player.Name} ~r~~w~!");
            player.SendChatMessage($"[~b~LSPD~w~]: ~b~{client.Name}~w~ à supprimer ton dossier ~r~~w~!");
            pInfo.Update();
            EventTriggers.Update_Wanteds(player);
        }
Exemplo n.º 4
0
        public void CMD_RemoveWanted(Client client, Client player, int wanteds)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

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

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

            if (player == null)
            {
                client.SendNotification("Le joueur n'a pas été trouvé!");
                return;
            }

            if (client.Name == player.Name)
            {
                client.SendNotification("~r~Vous ne pouvez pas vous spécifier!");
                return;
            }

            if (pInfo.wantedlevel - wanteds <= 0)
            {
                client.SendChatMessage("Vous ne pouvez pas donner au joueur pas moins de 0 Wanted!");
                return;
            }

            pInfo.wantedlevel -= wanteds;
            client.SendNotification($"[~b~LSPD~w~]: Vous avez enlevé un recherche à ~r~{player.Name}~w~ il à ~r~{wanteds} recherche~w~!");
            player.SendChatMessage($"[~b~LSPD~w~]: ~b~{client.Name}~w~ a vous ~r~{wanteds} recherche~w~ abgezogen!");
            pInfo.Update();
            EventTriggers.Update_Wanteds(player);
        }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
0
        public void CMD_SetWanted(Client client, Client player, int wanteds)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

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

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

            if (player == null)
            {
                client.SendNotification("Spieler wurde nicht gefunden!");
                return;
            }

            if (client.Name == player.Name)
            {
                client.SendNotification("~r~Du kannst dich nicht selber angeben!");
                return;
            }

            if (wanteds > 6)
            {
                client.SendChatMessage("Du kannst nicht mehr als 6 Wanteds verteilen!");
                return;
            }

            pInfo.wantedlevel += wanteds;
            client.SendNotification($"[~b~LSPD~w~]: Du hast ~r~{player.Name}~w~ erfolgreich ~r~{wanteds} Wanteds~w~ gegeben!");
            player.SendChatMessage($"[~b~LSPD~w~]: ~b~{client.Name}~w~ hat dir ~r~{wanteds} Wanteds~w~ gegeben!");
            pInfo.Update();
            EventTriggers.Update_Wanteds(player);
        }
Exemplo n.º 7
0
        public void CMD_DelAkte(Client client, Client player)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

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

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

            if (player == null)
            {
                client.SendNotification("Spieler wurde nicht gefunden!");
                return;
            }

            if (client.Name == player.Name)
            {
                client.SendNotification("~r~Du kannst dich nicht selber angeben!");
                return;
            }

            if (pInfo.wantedlevel > 4)
            {
                client.SendNotification("Dieser Spieler hat zu viele Wanteds!");
                return;
            }

            pInfo.wantedlevel = 0;
            client.SendNotification($"[~b~LSPD~w~]: Du hast die Akte von {player.Name} ~r~gelöscht~w~!");
            player.SendChatMessage($"[~b~LSPD~w~]: ~b~{client.Name}~w~ hat deine Akte ~r~gelöscht~w~!");
            pInfo.Update();
            EventTriggers.Update_Wanteds(player);
        }
Exemplo n.º 8
0
        public void CMD_RemoveWanted(Client client, Client player, int wanteds)
        {
            PlayerInfo pInfo = PlayerHelper.GetPlayerStats(player);

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

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

            if (player == null)
            {
                client.SendNotification("Spieler wurde nicht gefunden!");
                return;
            }

            if (client.Name == player.Name)
            {
                client.SendNotification("~r~Du kannst dich nicht selber angeben!");
                return;
            }

            if (pInfo.wantedlevel - wanteds <= 0)
            {
                client.SendChatMessage("Du kannst dem Spieler nicht weniger als 0 Wanteds geben!");
                return;
            }

            pInfo.wantedlevel -= wanteds;
            client.SendNotification($"~g~[POLICE]:~w~ Du hast ~r~{player.Name}~w~ erfolgreich ~r~{wanteds} Wanteds~w~ abgezogen!");
            player.SendChatMessage($"~g~[POLICE]: ~b~{client.Name}~w~ hat dir ~r~{wanteds} Wanteds~w~ abgezogen!");
            pInfo.Update();
            EventTriggers.Update_Wanteds(player);
        }
Exemplo n.º 9
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!");
        }
Exemplo n.º 10
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!");
        }