SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/08/2016, 06:38 PM   #1
ShoortyFl
Huge Clucker
 
Join Date: Apr 2014
Location: Malibu, CA
Posts: 336
Reputation: 16
Default problem with actors

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 Code:
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;
ShoortyFl is offline   Reply With Quote
Old 22/08/2016, 07:07 PM   #2
ShoortyFl
Huge Clucker
 
Join Date: Apr 2014
Location: Malibu, CA
Posts: 336
Reputation: 16
Default Re: problem with actors

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.
ShoortyFl is offline   Reply With Quote
Old 22/08/2016, 09:44 PM   #3
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,133
Reputation: 445
Default Re: problem with actors

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.
Abagail is offline   Reply With Quote
Old 24/08/2016, 12:31 AM   #4
ShoortyFl
Huge Clucker
 
Join Date: Apr 2014
Location: Malibu, CA
Posts: 336
Reputation: 16
Default Re: problem with actors

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).
ShoortyFl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Actors scripting spawning problem DavidMcRazy Scripting Help 9 02/12/2015 03:33 PM
Actors/Interiors problem. TaylorShade Scripting Help 2 19/11/2015 05:34 PM
Problem with actors Julien Sirasor Server Support 2 17/09/2015 04:40 PM
Actors problem AndreiWow Scripting Help 3 04/09/2015 05:04 PM
Problem Actors norton2 Scripting Help 3 15/05/2015 07:57 AM


All times are GMT. The time now is 06:45 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.