Advertisement
Guest User

Not that dumb

a guest
Dec 29th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using InfinityScript;
  4. using System.IO;
  5.  
  6. namespace WayPoints
  7. {
  8. public class WayPoints : BaseScript
  9. {
  10. List<Vector3> WayPointsList = new List<Vector3>();
  11. private void CreateCreate(Vector3 Position)
  12. {
  13. Entity Model = Call<Entity>("spawn", "script_model", Position);
  14. Model.Call("setmodel", "com_plasticcase_green_big_us_dirt");
  15. }
  16.  
  17. public WayPoints()
  18. {
  19. PlayerConnected += player => {
  20. player.Call("notifyonplayercommand", new Parameter[] { "setpoint", "+frag" });
  21. player.OnNotify("setpoint", ent =>
  22. {
  23. CreateCreate(player.Origin);
  24. WayPointsList.Add(ent.Origin);
  25. });
  26. };
  27. }
  28.  
  29. private void writeshit()
  30. {
  31. if (!File.Exists(@"scripts\\Waypoints.txt"))
  32. File.Create(@"scripts\\Waypoints.txt");
  33. foreach(Vector3 vec in WayPointsList)
  34. {
  35. File.AppendAllText(@"scripts\\Waypoints.txt", "{ " + vec.X.ToString() + ", " + vec.Y.ToString() + ", " + vec.Z.ToString() + " }");
  36. File.AppendAllText(@"scripts\\Waypoints.txt", Environment.NewLine);
  37. }
  38. }
  39.  
  40. public override EventEat OnSay2(Entity player, string name, string message)
  41. {
  42. if (message == "write")
  43. writeshit();
  44. return EventEat.EatGame;
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement