Jump to content

Login fail


Recommended Posts

 Hello i login on My Server.

The Message coming but if i try to do /veh Sultan i was no Loggin.

And i can do /login again but he must say i was Login ?



public void Login(bool firstLogin) {

            Player.Name = Name;
            if(!firstLogin) Playerdata.LoadPlayer(this);
            Player.SetData("PlayerData)", this);
            Player.SendChatMessage("Willkommen auf dem Server.");


 public static bool IsPlayerLoggedIn(Player player) {
            return player.HasData("Playerdata");


[Command("veh", "~g~Benutze: /vehicle [Fahrzeugname] um dir ein Fahrzeug zu Spawnen.", Alias = "vehicle")]
        public void CMD_Veh(Player player, string vehName) {
            if (!IPlayer.IsPlayerLoggedIn(player)) return;
            IPlayer iplayer = player.GetData<IPlayer>("PlayerData");
            if (!iplayer.HasAdminLevel((int)Adminranks.Admin)) {
                player.SendChatMessage("Du hast nicht genug Rechte");
            VehicleHash vehHash = NAPI.Util.VehicleNameToModel(vehName);
            if(vehHash == 0) {
                player.SendChatMessage("~r~Das eingegebene Fahrzeug existiert nicht.");
            if (player.HasData("PlayerData.Temp.Adminveh")) {
                Vehicle old_veh = player.GetData<Vehicle>("PlayerData.Temp.Adminveh");
            Vehicle veh = NAPI.Vehicle.CreateVehicle(vehHash, player.Position, player.Rotation, 5, 5);
            player.SetIntoVehicle(veh, 0);
            player.SendChatMessage($"Du hast dir ein {vehName} gespawnt.");
            player.SetData("PlayerData.Temp.Adminveh", veh);


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...