Store actor in a variable
#1

Hello,
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;
}
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?
Reply


Messages In This Thread
Store actor in a variable - by iDark - 12.11.2017, 20:55
Re: Store actor in a variable - by iDark - 12.11.2017, 21:25

Forum Jump:


Users browsing this thread: 1 Guest(s)