Quote:
Originally Posted by Grey83
No, weapon spawners have much larger indexes.
PHP Code:
public void OnMapStart()
{
char cls[32];
for(int i = 1, max = GetMaxEntities(); i <= max; i++)
if(IsValidEdict(i) && IsValidEntity(i)
&& GetEntityClassname(i, cls, sizeof(cls)) && !strncmp(cls, "weapon_", 7, false))
{
PrintToServer("\n Entity '%s' (Id: %i, MaxClients: %i)\n", cls, i, MaxClients);
break;
}
}
|
It's much faster to use
PHP Code:
int entity = -1;
while( (entity = FindEntityByClassname(entity, "weapon_*") != INVALID_ENT_REFERENCE) )
instead of a loop like this.
__________________