Author: AdiKesetovic
Sorry but I don't know Russian, but here goes a simple code to allow PD (Or anyone else you wanna add) to place beacons, for whatever reason, crime scene or something else ...
Just paste this somewhere in Commands.cs and in game use command "/bc" to put beacon.
You use the same command to remove them, just come near beacon and type "/bc".
Sorry but I don't know Russian, but here goes a simple code to allow PD (Or anyone else you wanna add) to place beacons, for whatever reason, crime scene or something else ...
Just paste this somewhere in Commands.cs and in game use command "/bc" to put beacon.
C#:
[Command("bc")]
public static void CMD_bc(Client player)
{
try
{
if (Main.Players[player].FractionID != 7) return;
if (Main.Players[player].FractionLVL < 5) return;
if (player.Dimension != 0) return;
if (player.HasData("PDOBJECT"))
{
var beacon = NAPI.Data.GetEntityData(player, "PDOBJECT");
try
{
NAPI.Entity.DeleteEntity(beacon);
NAPI.ColShape.DeleteColShape(player.GetData("PDOBJECTSHAPE"));
NAPI.Data.ResetEntityData(player, "PDOBJECT");
}
catch
{
}
}
else
{
var beacon = NAPI.Object.CreateObject(10928689, player.Position - new Vector3(0, 0, 1.0), new Vector3(0, 0, 0), 255, 0);
var beaconShape = NAPI.ColShape.CreateCylinderColShape(player.Position - new Vector3(0, 0, 1.0), 1, 2, 0);
beaconShape.OnEntityEnterColShape += (s, e) =>
{
if (!Main.Players.ContainsKey(e)) return;
e.SetData("PDOBJECT", beacon);
e.SetData("PDOBJECTSHAPE", beaconShape);
};
beaconShape.OnEntityExitColShape += (s, e) =>
{
if (!Main.Players.ContainsKey(e)) return;
e.ResetData("PDOBJECT");
};
}
}
catch
{
}
}
You use the same command to remove them, just come near beacon and type "/bc".
Последнее редактирование: