Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using InfinityScript;
- using System.IO;
- namespace WayPoints
- {
- public class WayPoints : BaseScript
- {
- List<Vector3> WayPointsList = new List<Vector3>();
- private void CreateCreate(Vector3 Position)
- {
- Entity Model = Call<Entity>("spawn", "script_model", Position);
- Model.Call("setmodel", "com_plasticcase_green_big_us_dirt");
- }
- public WayPoints()
- {
- PlayerConnected += player => {
- player.Call("notifyonplayercommand", new Parameter[] { "setpoint", "+frag" });
- player.OnNotify("setpoint", ent =>
- {
- CreateCreate(player.Origin);
- WayPointsList.Add(ent.Origin);
- });
- };
- }
- private void writeshit()
- {
- if (!File.Exists(@"scripts\\Waypoints.txt"))
- File.Create(@"scripts\\Waypoints.txt");
- foreach(Vector3 vec in WayPointsList)
- {
- File.AppendAllText(@"scripts\\Waypoints.txt", "{ " + vec.X.ToString() + ", " + vec.Y.ToString() + ", " + vec.Z.ToString() + " }");
- File.AppendAllText(@"scripts\\Waypoints.txt", Environment.NewLine);
- }
- }
- public override EventEat OnSay2(Entity player, string name, string message)
- {
- if (message == "write")
- writeshit();
- return EventEat.EatGame;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement