Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. [Command("slap")]
  2. public async void CMD_golpear(Client player, string idOrName)
  3. {
  4. if (player.HasData("ADMIN"))
  5. {
  6. var target = PlayeridManager.FindPlayer(idOrName);
  7. if (target == null)
  8. {
  9. utilities.Notification.SendNotificationERROR(player, "No existe ningún jugador con esta ID");
  10. return;
  11. }
  12.  
  13. if (player.IsInVehicle)
  14. {
  15. Vehicle veh = player.Vehicle;
  16. double vehx = veh.Position.X;
  17. double vehy = veh.Position.Y;
  18. double vehz = veh.Position.Z;
  19.  
  20. NAPI.ClientEvent.TriggerClientEvent(player, "freeze_entity_true");
  21. await Task.Delay(10);
  22. NAPI.ClientEvent.TriggerClientEvent(player, "freeze_entity_false");
  23.  
  24. double newvehz = vehz + 3;
  25. target.Position = new Vector3(vehx, vehy, newvehz);
  26.  
  27. utilities.Notification.SendNotificationOK(target, "Un administrador te ha golpeado, vehículo congelado 5 segundos");
  28. }
  29. else
  30. {
  31. double x = target.Position.X;
  32. double y = target.Position.Y;
  33. double z = target.Position.Z;
  34.  
  35. double newz = z + 3;
  36. target.Position = new Vector3(x, y, newz);
  37. utilities.Notification.SendNotificationOK(target, "Un administrador te ha golpeado");
  38. }
  39. }
  40. else player.SendChatMessage("<font color='red'>[ERROR]</font> El comando no existe. (/ayuda para mas información)");
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement