I'm having an issue with a plugin I'm creating and it refuses to compile and gives me this error: Error while compiling: IslandPatrol.cs(41,85): error CS1503: Argument `#3' cannot convert `method group' expression to type `string'
This is the code from line 41 to 85
// Schedule event check
timer.Every(60, CheckEventStatus);
}
privatevoidcmdForceEvent(IPlayerplayer, stringcommand, string[] args)
{
if (player.IsAdmin)
{
Puts("Forcing Island Patrol event...");
// Call the StartEvent method to simulate the event start
StartEvent();
}
}
privatevoidCheckEventStatus()
{
if (DateTime.UtcNow>=nextEventTime&&!isEventActive)
{
StartEvent();
}
}
privatevoidStartEvent()
{
// Spawn helicopters, CH-47s, Bradleys, and F-15s here
SpawnHelicopters();
SpawnCH47s();
SpawnBradleys();
SpawnF15s();
isEventActive=true;
timer.Once(UnityEngine.Random.Range(900, 1800), EndEvent); // Event lasts 15-30 mins
}
privatevoidSpawnHelicopters()
{
Vector3spawnPosition=newVector3(-2855, 47, -150); // Declare and set spawn coordinates
floatspawnInterval=5.0f;
for (inti=0; i<numberOfHelicopters; i++)
{
timer.Once(i*spawnInterval, () =>
- Error while compiling: IslandPatrol.cs(132,116): error CS0841: A local variable `spawnPosition' cannot be used before it i