Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Command("debug", Description = "Shows a list of debugging commands")]
- public void Command_Debug(Client sender)
- {
- sender.sendChatMessage("~b~Debug commands:");
- var list = API.getResourceCommands(Global.currentResource);
- string cmdLine = string.Empty;
- byte c = 0;
- foreach (var cmd in list)
- {
- var info = API.getResourceCommandInfo(Global.currentResource, cmd);
- sender.sendChatMessage((++c) + ") ~b~" + info.Command + (info.Usage.Length > 0 ? (" " + info.Usage) : "") + (info.Description.Length > 0 ? ("~w~ - " + info.Description) : ""));
- }
- }
- [Command("v", Description = "Spawns a vehicle", GreedyArg = true)]
- public void Command_Vehicle(Client player, string name)
- {
- if (!Utils.IsValidVehicle(name))
- {
- player.sendChatMessage("~r~Error:~w~ Not a valid vehicle.");
- return;
- }
- var v = API.createVehicle(API.vehicleNameToModel(name), API.getEntityPosition(player), new Vector3(), 0, 0, player.dimension);
- API.setPlayerIntoVehicle(player, v.handle, 1);
- API.sendNotificationToPlayer(player, "Spawned ~b~" + v.displayName);
- }
- [Command("w", Description = "Get a weapon", GreedyArg = true)]
- public void Command_Weapon(Client player, int ammo, string name)
- {
- if (!Utils.IsValidWeapon(name))
- {
- player.sendChatMessage("~r~Error:~w~ Not a valid wepaon.");
- return;
- }
- var w = API.weaponNameToModel(name);
- API.givePlayerWeapon(player, w, ammo, true, true);
- API.sendNotificationToPlayer(player, "Weapon: ~b~" + w.ToString());
- }
- [Command("s", Description = "Set a skin", GreedyArg = true)]
- public void Command_Skin(Client player, string name)
- {
- if (!Utils.IsValidSkin(name))
- {
- player.sendChatMessage("~r~Error:~w~ Not a valid skin.");
- return;
- }
- var s = API.pedNameToModel(name);
- API.setPlayerSkin(player, s);
- API.sendNotificationToPlayer(player, "Skin set to ~b~" + s.ToString());
- }
- [Command("godmod", Description = "Toggle invincibility")]
- public void Command_Godmod(Client player)
- {
- bool toggle = !API.getEntityInvincible(player.handle);
- API.setEntityInvincible(player.handle, toggle);
- API.sendNotificationToPlayer(player, "Godmod ~b~" + (toggle ? "ON" : "OFF"));
- }
- [Command("alpha", Description = "Sets your transparency", GreedyArg = true)]
- public void Command_Alpha(Client player, string al)
- {
- int alpha = Convert.ToInt32(al);
- if (alpha < 0) alpha = 0;
- if (alpha > 255) alpha = 255;
- API.setEntityTransparency(player.handle, alpha);
- API.sendNotificationToPlayer(player, "Alpha set to ~b~" + alpha);
- }
- [Command("weather", Description = "Sets the world weather", GreedyArg = true)]
- public void Command_Weather(Client player, string wea)
- {
- int weather = -1;
- bool flag = int.TryParse(wea, out weather);
- if (!flag || weather < 0 || weather > 13)
- player.sendChatMessage("~r~Invalid weather ID.");
- else
- {
- API.setWeather(weather);
- API.sendNotificationToAll("Weather set to ~b~" + Utils.GetWeatherName(weather) + "~w~ by ~b~" + player.name);
- }
- }
- [Command("time", Description = "Sets the world time", GreedyArg = true)]
- public void Command_Time(Client player, string hour, string minute)
- {
- int h = -1, m = -1;
- bool flag = int.TryParse(hour, out h),
- flag2 = int.TryParse(minute, out m);
- if (!flag || !flag2 || h < 0 || h > 23 || m < 0 || m > 59)
- player.sendChatMessage("~r~Invalid time.");
- else
- {
- API.setTime(h, m);
- API.sendNotificationToAll("Time set to ~b~" + h + ":" + m + "~w~ by ~b~" + player.name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement