SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 11/09/2018, 01:14 AM   #61
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 718
Reputation: 43
Default Re: Actors not spawning?

Probably is a stupid question but, do you have latest streamer include/plugin version? 🤔
KinderClans is offline   Reply With Quote
Old 11/09/2018, 07:14 AM   #62
Grim_
High-roller
 
Grim_'s Avatar
 
Join Date: Sep 2008
Location: United States
Posts: 2,862
Reputation: 118
Default Re: Actors not spawning?

60 replies for this, lord.

Quote:
Originally Posted by B-rian View Post
This makes me think that they fall through the map and then appear somewhere near where they fell.

Is there a way I can set a timer and make the actors spawn 5 seconds after the gamemode initiates?
I think you have it pinned. Take a look at this http://wiki.sa-mp.com/wiki/CreateActor

The actors can be pushed by vehicles, so the same assumption would be they can fall through the map. Try to increase your Z coordinate for the actor a bit (.5/1) and see if he stays in place. My guess would be his feet are spawned slightly into the ground causing him to clip through.
Grim_ is offline   Reply With Quote
Old 11/09/2018, 12:48 PM   #63
B-rian
Little Clucker
 
Join Date: Nov 2010
Posts: 46
Reputation: 0
Default Re: Actors not spawning?

Increasing the Z axis by 1 does not solve the issue and the actor is still in the wrong position.. Like I said before, once I move away slightly and come back he will be in the correct position. I've also noticed that when the actor is in the wrong position, the animation is not played.

EDIT: Alright guys I've gone for the nuclear option and I've set a timer that calls SetActorPos every 5 seconds.. This fixed the issue and as a bonus it fixes the position whenever the actor is pushed, so I guess I'll stick with this.
B-rian is offline   Reply With Quote
Old 11/09/2018, 02:18 PM   #64
solstice_
Gangsta
 
solstice_'s Avatar
 
Join Date: Feb 2016
Location: basement
Posts: 540
Reputation: 68
Default Re: Actors not spawning?

I wouldn't do that if I was you tho, whatever..
solstice_ is offline   Reply With Quote
Old 11/09/2018, 04:09 PM   #65
B-rian
Little Clucker
 
Join Date: Nov 2010
Posts: 46
Reputation: 0
Default Re: Actors not spawning?

It's definitely not the solution I want as it is one more check that shouldn't be happening.. but as I cannot think of anything else to try to fix this, it's going to have to do.
B-rian is offline   Reply With Quote
Old 11/09/2018, 04:32 PM   #66
Grim_
High-roller
 
Grim_'s Avatar
 
Join Date: Sep 2008
Location: United States
Posts: 2,862
Reputation: 118
Default Re: Actors not spawning?

Did you two read the wiki? This is exactly what it suggests doing. There will be no performance issue.
Grim_ is offline   Reply With Quote
Old 11/09/2018, 04:46 PM   #67
B-rian
Little Clucker
 
Join Date: Nov 2010
Posts: 46
Reputation: 0
Default Re: Actors not spawning?

That's why I did it, the wiki suggestion seemed alright since it also resets their position incase they get pushed.
B-rian is offline   Reply With Quote
Old 11/09/2018, 06:38 PM   #68
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 718
Reputation: 43
Default Re: Actors not spawning?

Do you mind posting here the timer code you're using? Thanks.
KinderClans is offline   Reply With Quote
Old 11/09/2018, 08:08 PM   #69
B-rian
Little Clucker
 
Join Date: Nov 2010
Posts: 46
Reputation: 0
Default Re: Actors not spawning?

Sure thing:

Code:
forward SetActorPosition();
new ActorOGF;
new ActorLSB;
new ActorLSV;

public OnGameModeInit()
{
 
 ActorOGF = CreateActor(28, 2438.7710,-1901.5355,13.5534,322.5977); //Actor OGF
 ApplyActorAnimation(ActorOGF, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0);
 ActorLSV = CreateActor(30, 2700.7739,-1106.5424,69.5781,139.4486); // Actor LSV
 ApplyActorAnimation(ActorLSV, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0);
 ActorLSB = CreateActor(183, 1974.7064,-1306.3206,20.8374,268.4688); //Actor LSB
 ApplyActorAnimation(ActorLSB, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0);
 
 
 SetTimer("SetActorPosition", 5000, 1);

 return 1;

}

public SetActorPosition()
{
   SetActorPos(ActorOGF, 2438.7710,-1901.5355,13.5534);
   SetActorPos(ActorLSV, 2700.7739,-1106.5424,69.5781);
   SetActorPos(ActorLSB, 1974.7064,-1306.3206,20.8374);

   return 1;
}
B-rian is offline   Reply With Quote
Old 11/09/2018, 08:22 PM   #70
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 718
Reputation: 43
Default Re: Actors not spawning?

Thank you.
KinderClans 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
[Tutorial] Actors!(0.3.7 RC6) Abagail Tutorials 31 25/06/2018 08:33 PM
About actors Eyce Scripting Help 3 18/04/2016 02:51 PM
Actors scripting spawning problem DavidMcRazy Scripting Help 9 02/12/2015 04:33 PM
[Help] Actors Andy5 Scripting Help 4 06/08/2015 10:55 PM
Actors ATomas Scripting Help 17 30/04/2015 05:55 PM


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


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