GetActorPos is not working or updating!
#1

Hello.
It seems that you can move actors and their original position does not change or update:



When I try to check for changes in position, nothing happens:
PHP Code:
#define Loop(%0,%1,%2) for(new %0 = %2; %0 < %1; %0++)
new ActorPos[MAX_ACTORS][4];
stock new_CreateActor(skin,Float:x,Float:y,Float:z,Float:a)
{
    new 
aid CreateActor(skin,x,y,z,a);
    
ActorPos[aid][0] = x,ActorPos[aid][1] = y,ActorPos[aid][2] = z,ActorPos[aid][3] = a;
    
SetActorVirtualWorld(aid0);
    
SetActorInvulnerable(aid1);
    return 
aid;
}
stock CheckActorPos()
{
    new 
Float:Pos[3];
    
Loop(i,GetActorPoolSize()+1,0)
    {
        if(
IsValidActor(i))
        {
            if(
GetActorVirtualWorld(i) == 0)
            {
                
GetActorPos(iPos[0], Pos[1], Pos[2]);
                if(
Pos[0] != ActorPos[i][0] || Pos[1] != ActorPos[i][1] || Pos[2] != ActorPos[i][2])
                {
                    
SetActorPos(iActorPos[i][0],ActorPos[i][1],ActorPos[i][2]);
                    
SetActorFacingAngle(iActorPos[i][3]);
                }
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
GetActorPos is not working or updating! - by JR_Junior - 15.05.2018, 17:17
Re: GetActorPos is not working or updating! - by Pottus - 15.05.2018, 22:48
Re: GetActorPos is not working or updating! - by JR_Junior - 16.05.2018, 04:29
Re: GetActorPos is not working or updating! - by Spmn - 16.05.2018, 16:53
Re: GetActorPos is not working or updating! - by NaS - 16.05.2018, 23:04

Forum Jump:


Users browsing this thread: 2 Guest(s)