Пример #1
0
        //Verification compte existant + Freeze et application de la camera connexion

        private void OnPlayerFinishedDownloadHandler(Client player)
        {
            if (IsBan(player))
            {
                API.kickPlayer(player, "~r~Tu es banni du serveur, Rendez-vous sur Generation-Five.fr pour plus d'informations");
            }
            else
            {
                PlayerInfo objplayer = new PlayerInfo(player);
                //player.freeze(true);
                Cams.createCameraActive(player, new Vector3(332.8148, -1625.127, 98.49599), new Vector3(0, 0, 18.26657));
                //API.setEntityPosition(player, new Vector3(334.1689, -1628.986, 98.49599));
                API.sleep(5000);
                API.triggerClientEvent(player, "showLogin");
                if (CompteJoueurExistant(player) != -1)
                {
                    API.sendChatMessageToPlayer(player, "~s~Bienvenue sur ~b~GenerationFive~s~.");
                    API.sendChatMessageToPlayer(player, "~s~Tu es connecté avec le compte social club~b~ " + player.socialClubName + "~s~.");
                    API.sendChatMessageToPlayer(player, "~s~Ton compte rôleplay a été trouvé au nom de ~b~" + Fonction.RemoveUnderscore(player.name) + "~s~.");
                    API.sendChatMessageToPlayer(player, "~s~Version actuelle du serveur ~b~" + Constante.Version + "~s~.");
                    return;
                }
                else
                {
                    API.sendChatMessageToPlayer(player, "~s~Bienvenue sur ~b~GenerationFive~s~.");
                    API.sendChatMessageToPlayer(player, "~s~Tu es connecté avec le compte social club~b~ " + player.socialClubName + " ~s~.");
                    API.sendChatMessageToPlayer(player, "~s~Tu n'as ~b~pas encore de compte rôleplay~s~, entre un ~b~mot de passe ~s~pour en créer un.");
                    API.sendChatMessageToPlayer(player, "~s~Version actuelle du serveur ~b~" + Constante.Version + "~s~.");
                }
            }
        }
Пример #2
0
        public void SpawnPlayer(Client player)
        {
            PlayerInfo objplayer = PlayerInfo.GetPlayerInfoObject(player);
            DataTable  result    = API.exported.database.executeQueryWithResult("SELECT * FROM UtilisateurVisage WHERE ID = " + objplayer.dbid);

            {
                if (result.Rows.Count != 1)
                {
                    API.call("CharCreator", "SendToCreator", player);
                    return;
                }
            }
            API.call("CharCreator", "LoadCharacter", player);
            LoadVetements(player);
            LoadAccessoires(player);
            //LoadAmende(player);
            API.setEntityPosition(player, objplayer.position);
            API.setEntityRotation(player, objplayer.rotation);
            API.setEntityDimension(player, objplayer.dimension);
            API.setPlayerHealth(player, objplayer.sante);
            if (objplayer.factionid != Constante.Faction_Police)
            {
                API.setPlayerArmor(player, objplayer.armure);
                API.call("SaveWeapons", "Load", player);
            }
            if (objplayer.IsMenotter == true)
            {
                API.setPlayerClothes(player, 7, (objplayer.sexe == 0 ? 41 : 25), 0);
                API.playPlayerAnimation(player, (int)(AnimationFlags.Loop | AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl), "mp_arresting", "idle");
            }
            if (objplayer.IsDead == true)
            {
                API.playPlayerAnimation(player, (int)(SystemeMort.AnimationFlags.StopOnLastFrame), "combat@death@from_writhe", "death_c");
            }

            /*API.sendNativeToPlayer(player, Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, 631614199, 464.5701f, -992.6641f, 25.06443f, true, 0); //Porte principale des cellules
             * API.sendNativeToPlayer(player, Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, 631614199, 461.8065f, -994.4086f, 25.06443f, true, 0); //Porte Cellule 1
             * API.sendNativeToPlayer(player, Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, 631614199, 461.8065f, -997.6583f, 25.06443f, true, 0); //Porte Cellule 2
             * API.sendNativeToPlayer(player, Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, 631614199, 461.8065f, -1001.302f, 25.06443f, true, 0); //Porte Cellule 3
             * API.sendNativeToPlayer(player, Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, -1033001619, 463.4782f, -1003.538f, 25.00599f, true, 0); //Porte Arriere Cellules*/
            API.sendNativeToPlayer(player, Hash.SET_STATE_OF_CLOSEST_DOOR_OF_TYPE, 1557126584, 450.1041f, -985.7384f, 30.8393f, true, 0); //Porte Acces Vestiere

            Cams.clearCameras(player);

            objplayer.Spawned = true;

            API.delay(1000, true, () => { API.call("DoorManager", "refreshallDoor", player); });
            API.delay(2000, true, () => { API.call("DoorManager", "refreshallDoor", player); });
            API.delay(5000, true, () => { API.call("DoorManager", "refreshallDoor", player); });
            API.delay(6000, true, () => { API.call("DoorManager", "refreshallDoor", player); });
            API.delay(7000, true, () => { API.call("DoorManager", "refreshallDoor", player); });
        }