Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Command("slap")]
- public async void CMD_golpear(Client player, string idOrName)
- {
- if (player.HasData("ADMIN"))
- {
- var target = PlayeridManager.FindPlayer(idOrName);
- if (target == null)
- {
- utilities.Notification.SendNotificationERROR(player, "No existe ningún jugador con esta ID");
- return;
- }
- if (player.IsInVehicle)
- {
- Vehicle veh = player.Vehicle;
- double vehx = veh.Position.X;
- double vehy = veh.Position.Y;
- double vehz = veh.Position.Z;
- NAPI.ClientEvent.TriggerClientEvent(player, "freeze_entity_true");
- await Task.Delay(10);
- NAPI.ClientEvent.TriggerClientEvent(player, "freeze_entity_false");
- double newvehz = vehz + 3;
- target.Position = new Vector3(vehx, vehy, newvehz);
- utilities.Notification.SendNotificationOK(target, "Un administrador te ha golpeado, vehículo congelado 5 segundos");
- }
- else
- {
- double x = target.Position.X;
- double y = target.Position.Y;
- double z = target.Position.Z;
- double newz = z + 3;
- target.Position = new Vector3(x, y, newz);
- utilities.Notification.SendNotificationOK(target, "Un administrador te ha golpeado");
- }
- }
- else player.SendChatMessage("<font color='red'>[ERROR]</font> El comando no existe. (/ayuda para mas información)");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement