Author Topic: Stumped in /ClearProjectiles  (Read 1851 times)

This doesn't seem to work...

Code: [Select]
function servercmdclearAllProjectiles(%client)
{
if(!%client.isSuperAdmin)
return;

%count = missionCleanupgroup.getCount();

for(%i = 0; %i < %count; %i++)
{
%obj = missionCleaupgroup.getObject(%i);

if(%obj.getClassName() $= "Projectile")
%obj.delete();
}
}

There is no such thing as missionCleanupgroup, it's called MissionCleanup.
You should be looping backwards (from ::getCount() - 1 to 0) instead, too.

Actually, you should just be using /cancelAllEvents.

There is no such thing as missionCleanupgroup, it's called MissionCleanup.
You should be looping backwards (from ::getCount() - 1 to 0) instead, too.

Actually, you should just be using /cancelAllEvents.

Ok, thanks.

Actually, you should just be using /cancelAllEvents.
No. This has many side effects that have nothing to do with what he wants.


Don't give up on it. Your script looks almost done anyway. The experience is worth it. Did you write that code yourself?

He did. Even though I have released something, you shouldn't really stop, keep going. You could make it better.

He did. Even though I have released something, you shouldn't really stop, keep going. You could make it better.

I guess so,