new command to list entities of a certain type
enumentities <entity type name> Returns a list of the numbers of all entities of that type. If no such entities exist or the entity type could not be recognised, the list is empty. DOCREF enumentities
This commit is contained in:
@@ -95,6 +95,7 @@ looplist [
|
||||
newent ents
|
||||
clearents ents
|
||||
closestenttype ents
|
||||
enumentities ents
|
||||
weapon weapons
|
||||
burstshots weapons
|
||||
team teamnames
|
||||
|
||||
@@ -418,6 +418,16 @@ void editentity(char **args, int numargs) // index x y z a1 a2 a3 a4 ...
|
||||
}
|
||||
COMMAND(editentity, "v");
|
||||
|
||||
void enumentities(char *type)
|
||||
{
|
||||
vector<char> res;
|
||||
int t = getlistindex(type, entnames, false, -1);
|
||||
loopv(ents) if(ents[i].type == t) cvecprintf(res, "%d ", i);
|
||||
if(!res.length()) res.add('\0');
|
||||
else res.last() = '\0';
|
||||
result(res.getbuf());
|
||||
}
|
||||
COMMAND(enumentities, "s");
|
||||
|
||||
void scalecomp(uchar &c, int intens)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user