GetActorPoolSize
attention
La fonctionnalité de type fonction a été ajoutée dans la version SA-MP 0.3.7 et ne fonctionne pas avec les versions antérieures !
Description
Gets the highest actorid created on the server. Note that in SA:MP this function is broken and will return 0 even when there are no actors. open.mp correct this to return -1, but also deprecate the function in favour of MAX_ACTORS or foreach.
Examples
SetAllActorsHealth(Float:health)
{
for (new i = 0, j = GetActorPoolSize(); i <= j; i++)
{
if (IsValidActor(i))
{
SetActorHealth(i, health);
}
}
}
Related Functions
- CreateActor: Create an actor (static NPC).
- IsValidActor: Check if actor id is valid.
- SetActorHealth: Set the health of an actor.