Jump to content
RAGE Multiplayer Community

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 ?

 

Zitat

public void Login(bool firstLogin) {

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

Zitat

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

Zitat

[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");
                return;
            }
            VehicleHash vehHash = NAPI.Util.VehicleNameToModel(vehName);
            if(vehHash == 0) {
                player.SendChatMessage("~r~Das eingegebene Fahrzeug existiert nicht.");
                return;
            }
            if (player.HasData("PlayerData.Temp.Adminveh")) {
                Vehicle old_veh = player.GetData<Vehicle>("PlayerData.Temp.Adminveh");
                old_veh.Delete();
            }
            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 post
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...