Author Topic: /clearallprojectiles and /cleartools PLAYER  (Read 604 times)

/clearallprojectiles

Pretty self explain, but a few Options.


Host  --> Host only
SA  --> Only SA and host can use it
Admin  --> When picked both SA and Admin can use it (including host)

And if someone could make it work with the Moderator addon that would be cool.

That is all,

For those who are to dumb to figure out what this does-

When said all the projectiles in the server go away.


/cleartools PLAYER

When said, for example, if you typed /cleartools Ducky Duck
That player's tools would go away,

And the same settings as the other one

Quote
Host  --> Host only
SA  --> Only SA and host can use it
Admin  --> When picked both SA and Admin can use it (including host)

And if someone could make it work with the Moderator addon that would be cool.


for the first one, you can make all evented projectiles disappear with /cancelevents

I think this can be done, but it would rely on add-ons following standard procedure. You could package simgroup::Add() to check all objects being added to the missioncleanup group, test if they are a projectile, find the lowest unoccupied spot in a simlist and then add them to it.  When the /clearallprojectiles command is used, iterate through the list to delete all the projectiles on it. Unfortunately, this puts a big strain on whenever projectiles are created.

Actually, scratch all of that. Just iterate through the missioncleanup group and delete all the projectiles.
« Last Edit: February 17, 2014, 10:06:59 PM by Pecon »

Here, someone go ahead and package this up and test it.
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();
}
}

function servercmdClearTools(%client, %name)
{
if(!%client.isSuperAdmin)
return;

if(!isObject(%player = findClientbyName(%name).player))
{
%client.chatMessage("No player!");
return;
}

for(%i = 0; %i < 12; %i++) //silly playertypes adding so many slots!
{
%player.tool[%i] = "";
}
}