problem with actors - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: problem with actors (
/showthread.php?tid=615463)
problem with actors -
ShoortyFl - 22.08.2016
Hello, i have an problem with actors.
Basically, when i create them, and apply animation on them they move from the position they should spawn, sometimes like 10-20ft away, cant see what the problem is, can you please check the code:
pawn Код:
new string[128];
format(string,sizeof(string), "SPAWNED PED");
HitnaInfo[playerid][PedText] = CreateDynamic3DTextLabel(string, -1, MedicSpawn[Random][0], MedicSpawn[Random][1], MedicSpawn[Random][2] + 0.8, 5.0, INVALID_PLAYER_ID,INVALID_VEHICLE_ID);
HitnaInfo[playerid][Actor] = CreateActor(rsk, MedicSpawn[Random][0], MedicSpawn[Random][1], MedicSpawn[Random][2], MedicSpawn[Random][3]);
ApplyActorAnimation(HitnaInfo[playerid][Actor], "BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
c_SetPlayerCheckpoint(playerid, MedicSpawn[Random][0], MedicSpawn[Random][1], MedicSpawn[Random][2], 3.0);
GPSOn[playerid] = 1;
Re: problem with actors -
ShoortyFl - 22.08.2016
Nm, came up with a solution.
Store actors pos in a global variable and then run timer (i run it every 10 secs) to restore its pos with SetActorPos.
Re: problem with actors -
Abagail - 22.08.2016
I think other people have had the same problem, it's likely a desync bug. You also shouldn't need to run a timer every ten seconds, a minute timer should do the trick assuming it's not something in your script doing this.
Re: problem with actors -
ShoortyFl - 24.08.2016
Yes, it is a bug, I'm guessing that developers are aware of this issue, but didn't see them confirm the problem.
I figured out that it has nothing to do with using animation on actor(for which I've thought was the problem from the start).