public void SpawnPlayerCar(Player pl)
 {
     int model = 415; //cheetah
     Vehicle v = World.CreateVehicle(model, pl.Pos, pl.ZAngle, 0, 0, 600); // spawn the vehicle
     pl.Vehicle = v; // put player in the vehicle
     pl.ClientMessage(0, "{00FF00}Spawning vehicle."); // send the player a message
 }
        public static void OnPlayerCommandText(object sender, Player.OnPlayerCommandTextEventArgs args)
        {
            string[] cmd = args.text.Split(' ');

            if (String.Compare(cmd[0], "/gmlogin") == 0)
            {
                if (cmd.Length < 2) return; // no password supplied
                if (String.Compare(cmd[1], GMLoginPass) != 0)
                {
                    args.player.ClientMessage(0, "{FF0000}Incorrect password.");
                    return;
                }
                args.player.ClientMessage(0, "{00FF00}GM login successful.");
                args.player.PrivLevel = (int)Player.PRIV_LEVELS.GM;
                return;
            }

            if (ScriptManager.Instance == null) return; // scriptmanager is a singleton
            if (String.Compare(cmd[0], "/reloadscripts") == 0)
            {
                if (args.player.PrivLevel < (int)Player.PRIV_LEVELS.GM)
                {
                    args.player.ClientMessage(0, "{FF0000}Insufficient privlevel to reload scripts.");
                    return;
                }
                args.player.ClientMessage(0,"{00FF00}Reloading All Scripts.");
                ScriptManager.Instance.ReloadAllScripts();
            }
        }
 public void OnPlayerCommandText(object sender, Player.OnPlayerCommandTextEventArgs args)
 {
     string[] cmd = args.text.Split(' ');
     if (String.Compare(cmd[0], "/v") == 0)
     {
         SendVehicleDialog(args.player);
     }
 }
 public void OnPlayerCommandText(object sender, Player.OnPlayerCommandTextEventArgs args)
 {
     string[] cmd = args.text.Split(' ');
     if (Samp.Util.Util.strcmp(cmd[0], "/car") == 0)
     {
         SpawnPlayerCar(args.player);
     }
 }
 public void SendVehicleDialog(Player pl)
 {
     API.Dialog d = new Dialog();
     d.Name = "Vehicles";
     d.Style = 2;
     d.Button1 = "Spawn";
     d.Button2 = "Close";
     d.Info = "";
     for (int i = 0; i < Vehicles.Length; i++)
     {
         d.Info += Vehicles[i].Name + "\r\n";
     }
     d.ShowDialogForPlayer(pl);
 }
 public void SpawnVehicle(Player pl, int listitem)
 {
     int model = Vehicles[listitem].Model;
     Vehicle v = World.CreateVehicle(model, pl.Pos, pl.ZAngle, 0, 0, 600); // spawn the vehicle
     pl.Vehicle = v; // put player in the vehicle
     pl.ClientMessage(0, "{00FF00}Spawning vehicle."); // send the player a message
 }
示例#7
0
 public OnDialogResponseEventArgs(Player pl, Dialog d,int respons, int item, string input)
 {
     player = pl;
     dialog = d;
     response = respons;
     listitem = item;
     inputtext = input;
 }
示例#8
0
 public OnPlayerKeyStateChangeEventArgs(Player pl, int newkeysbitmask, int oldkeysbitmask)
 {
     player = pl;
     newkeys = newkeysbitmask;
     oldkeys = oldkeysbitmask;
 }
示例#9
0
 public void ShowDialogForPlayer(Player pl)
 {
     pl.ShowDialog(this);
 }
示例#10
0
 public OnPlayerKeyPressedEventArgs(Player pl, int key)
 {
     player = pl;
     Key = key;
 }
示例#11
0
 public OnPlayerDeathEventArgs(Player pl, Player kilr)
 {
     player = pl;
     killer = kilr;
 }
示例#12
0
 public OnPlayerConnectEventArgs(Player pl)
 {
     player = pl;
 }
示例#13
0
 public OnPlayerCommandTextEventArgs(Player pl, string txt)
 {
     player = pl;
     text = txt;
 }
示例#14
0
 internal static bool RemovePlayer(Player p)
 {
     //if (OnPlayerDestroyed != null) OnPlayerDestroyed(null, new OnPlayersCreatedEventArgs(this));
     lock (Players)
     {
         for (int i = 0; i < Players.Count(); i++)
         {
             if (Players[i] == null) continue;
             if (Players[i] == p) { Samp.Util.Log.Debug("Removing Player."); Players[i] = null; return true; }
         }
     }
     return false;
 }