Ejemplo n.º 1
0
        public static string WhichFrak(Client client)
        {
            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);
            string     frak;
            int        zahl = 0;

            if (playerInfo.fraktion == 1)
            {
                zahl = 1;
            }

            if (playerInfo.fraktion == 2)
            {
                zahl = 2;
            }

            if (playerInfo.fraktion == 3)
            {
                zahl = 3;
            }

            switch (zahl)
            {
            case 1:
                frak = "LSPD";
                break;

            case 2:
                frak = "SARU";
                break;

            case 3:
                frak = "Grove Street";
                break;

            default:
                frak = "Keine";
                break;
            }

            return(frak);
        }
Ejemplo n.º 2
0
        public static string WhichADMIN(Client client)
        {
            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);
            string     rang;
            int        zahl = 0;

            if (playerInfo.adminrank == 1)
            {
                zahl = 1;
            }

            if (playerInfo.adminrank == 2)
            {
                zahl = 2;
            }

            if (playerInfo.adminrank == 3)
            {
                zahl = 3;
            }

            switch (zahl)
            {
            case 1:
                rang = "Supporter";
                break;

            case 2:
                rang = "Admin";
                break;

            case 3:
                rang = "Serverleiter";
                break;

            default:
                rang = "Bürger";
                break;
            }

            return(rang);
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
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~Du hast Offlineflucht begangen und sitzt nun 5 Minuten länger im Gefängnis!");
                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;
        }
Ejemplo n.º 5
0
        public static void LoadTunes(Client client, Vehicle vehicle)
        {
            PlayerVehicles pVeh = PlayerHelper.GetpVehiclesStats(client);

            NAPI.Vehicle.SetVehiclePrimaryColor(vehicle, pVeh.Color1);
            NAPI.Vehicle.SetVehicleSecondaryColor(vehicle, pVeh.Color2);
            NAPI.Vehicle.SetVehicleMod(vehicle, 0, pVeh.spoilers);
            NAPI.Vehicle.SetVehicleMod(vehicle, 1, pVeh.fbumber);
            NAPI.Vehicle.SetVehicleMod(vehicle, 2, pVeh.rbumber);
            NAPI.Vehicle.SetVehicleMod(vehicle, 3, pVeh.sskirt);
            NAPI.Vehicle.SetVehicleMod(vehicle, 4, pVeh.exhaust);
            NAPI.Vehicle.SetVehicleMod(vehicle, 5, pVeh.frame);
            NAPI.Vehicle.SetVehicleMod(vehicle, 6, pVeh.grill);
            NAPI.Vehicle.SetVehicleMod(vehicle, 10, pVeh.roof);
            NAPI.Vehicle.SetVehicleMod(vehicle, 11, pVeh.motortuning);
            NAPI.Vehicle.SetVehicleMod(vehicle, 12, pVeh.brakes);
            NAPI.Vehicle.SetVehicleMod(vehicle, 13, pVeh.transmission);
            NAPI.Vehicle.SetVehicleMod(vehicle, 18, pVeh.turbo);
            NAPI.Vehicle.SetVehicleMod(vehicle, 23, pVeh.fwheels);
            NAPI.Vehicle.SetVehicleMod(vehicle, 24, pVeh.bwheels); //MOTORAD
            NAPI.Vehicle.SetVehicleWindowTint(vehicle, pVeh.window);
            NAPI.Vehicle.SetVehicleMod(vehicle, 15, pVeh.suspension);
        }
Ejemplo n.º 6
0
        public static void GetLastCarPosition(Client client)
        {
            Vehicle personal_vehicle = client.GetData("PersonalVehicle");

            int client_id = client.GetData("ID");

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


            if (pVeh == null)
            {
                return;
            }

            if (pVeh._id == client_id)
            {
                Vector3 pVehSpawn = new Vector3(pVeh.last_location[0], pVeh.last_location[1], pVeh.last_location[2]);

                //client.SendChatMessage("~g~Du besitzt ein Fahrzeug!");
                uint    pVehHash = NAPI.Util.GetHashKey(pVeh.carmodel);
                Vehicle veh      = NAPI.Vehicle.CreateVehicle(pVehHash, pVehSpawn, pVeh.last_rotation, 0, 0);
                //NAPI.Vehicle.SetVehicleEngineStatus(veh, false);
                NAPI.Vehicle.SetVehicleNumberPlate(veh, client.Name);

                NAPI.Vehicle.SetVehicleLocked(veh, true);
                NAPI.Vehicle.SetVehicleEngineStatus(veh, false);
                NAPI.Vehicle.SetVehicleExtra(veh, 0, true);

                //Tunes
                LoadTunes(client, veh);

                client.SetData("Engine", false);
                client.SetData("PersonalVehicle", veh);
                veh.SetData("ID", client_id);
            }
        }
Ejemplo n.º 7
0
        public static string WhichFrak(Client client)
        {
            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);

            return(frakNames[(playerInfo.fraktion > frakNames.Length) ? 0 : playerInfo.fraktion]);
        }
Ejemplo n.º 8
0
        public static string WhichADMIN(Client client)
        {
            PlayerInfo playerInfo = PlayerHelper.GetPlayerStats(client);

            return(rankNames[(playerInfo.adminrank > rankNames.Length) ? 0 : playerInfo.adminrank]);
        }