Advertisement
GTA5HelpDesk

Menyoo Map to Script

Jul 5th, 2023
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. using GTA;
  2. using GTA.Math;
  3. using GTA.Native;
  4. using System;
  5. using System.Collections.Generic;
  6.  
  7. namespace TheMenyooMapTemplate
  8. {
  9.  
  10. public class Main : Script
  11. {
  12.  
  13. public Main()
  14. {
  15. Tick += Ontick;
  16. Aborted += OnShutDown;
  17. }
  18.  
  19.  
  20. public ObjectPlacementMap_Example.MissionOjects Map = new ObjectPlacementMap_Example.MissionOjects(new List<ObjectPlacementMap_Example.ObjectPlacementMap>()
  21. {
  22.  
  23. //place the output from your xml conversion, same name as Menyoo Map here
  24.  
  25. });
  26.  
  27. public bool Map_Created;
  28.  
  29. public void Ontick(object sender, EventArgs e)
  30. {
  31. if (!Map_Created)
  32. {
  33. for (int i = 0; i < Map.Entities.Count; i++)
  34. {
  35. if (Game.Player.Character.Position.DistanceTo(Map.Entities[i].Position)< 100)
  36. {
  37. Map_Created = true;
  38. Map.CreateEntites();
  39. }
  40.  
  41. }
  42. if (Game.Player.Character.Position.DistanceTo(Map.Entities[0].Position) < 100)
  43. {
  44. Map_Created = true;
  45. Map.CreateEntites();
  46. }
  47. if (Game.Player.Character.Position.DistanceTo(new Vector3(500,500,500)) < 100) //Your x,y,z coords
  48. {
  49. Map_Created = true;
  50. Map.CreateEntites();
  51. }
  52.  
  53.  
  54. }
  55.  
  56. }
  57. public void OnShutDown(object sender, EventArgs e)
  58. {
  59. Map.DeleteEntites();
  60. }
  61.  
  62.  
  63. }
  64.  
  65.  
  66.  
  67. }
  68.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement