`Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
at CounterStrikeSharp.API.Core.Helpers.InvokeNative(IntPtr)
at CounterStrikeSharp.API.Core.ScriptContext.InvokeNativeInternal()
at CounterStrikeSharp.API.Core.ScriptContext.Invoke()
at CounterStrikeSharp.API.Core.NativeAPI.ExecuteVirtualFunction[[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](IntPtr, System.Object[])
at CounterStrikeSharp.API.Modules.Memory.DynamicFunctions.BaseMemoryFunction.InvokeInternalVoid(System.Object[])
at CounterStrikeSharp.API.Modules.Memory.DynamicFunctions.MemoryFunctionVoid`6[[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(IntPtr, System.Canon, IntPtr, IntPtr, System.__Canon, Int32)
at CounterStrikeSharp.API.Core.CEntityInstance.AcceptInput(System.String, CounterStrikeSharp.API.Core.CEntityInstance, CounterStrikeSharp.API.Core.CEntityInstance, System.String, Int32)`
code:
` public static void ScheduleCTPositions(Vector position, QAngle angle)
{
var ctSpawns = Utilities.FindAllEntitiesByDesignerName<CBaseEntity>("info_player_terrorist");
foreach (var entity in ctSpawns)
{
if (entity.IsValid)
{
entity.AcceptInput("SetDisabled");
}
}
var NewEntity = Utilities.CreateEntityByName<CInfoPlayerTerrorist>("info_player_terrorist");
NewEntity.Teleport(position, angle, new Vector(0, 0, 0));
NewEntity.DispatchSpawn();
}`
`Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Repeat 2 times:
at CounterStrikeSharp.API.Core.Helpers.InvokeNative(IntPtr)
at CounterStrikeSharp.API.Core.ScriptContext.InvokeNativeInternal() at CounterStrikeSharp.API.Core.ScriptContext.Invoke() at CounterStrikeSharp.API.Core.NativeAPI.ExecuteVirtualFunction[[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](IntPtr, System.Object[]) at CounterStrikeSharp.API.Modules.Memory.DynamicFunctions.BaseMemoryFunction.InvokeInternalVoid(System.Object[]) at CounterStrikeSharp.API.Modules.Memory.DynamicFunctions.MemoryFunctionVoid`6[[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.IntPtr, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Canon, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(IntPtr, System.Canon, IntPtr, IntPtr, System.__Canon, Int32) at CounterStrikeSharp.API.Core.CEntityInstance.AcceptInput(System.String, CounterStrikeSharp.API.Core.CEntityInstance, CounterStrikeSharp.API.Core.CEntityInstance, System.String, Int32)`
code: ` public static void ScheduleCTPositions(Vector position, QAngle angle) {