12.11.2017, 20:55
Hello,
When I try to store an actor ID into a variable it doesn't work properly.
If I type command test the actor is created but if someone else type this command it removes my actor and create just for them.
And I tried to verify IsValidActor(pActor[x]) with x with random values and after I run command /test IsValidActor(pActor[x]) gives true for all x (0-999) even if I created just an actor.
Is there a way to store an Actor id for a player variable?
When I try to store an actor ID into a variable it doesn't work properly.
Код:
CMD:test(playerid, params[])
{
if(IsValidActor(pActor[playerid])) DestroyActor(pActor[playerid]);
pActor[playerid] = CreateActor(0, 0.0, 0.0, 0.0, 3.0);
SetActorVirtualWorld(pActor[playerid], playerid);
return 1;
}
And I tried to verify IsValidActor(pActor[x]) with x with random values and after I run command /test IsValidActor(pActor[x]) gives true for all x (0-999) even if I created just an actor.
Is there a way to store an Actor id for a player variable?

