SA-MP Forums Archive
Actor question - 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: Actor question (/showthread.php?tid=658790)



Actor question - DarknesS1988 - 12.09.2018

I have created an actor he doesn't take damage which is okay. But the next thing is problem:
Iam punching it and he moves, not from his spot but he does this:




I want to keep him in position like this without "moving" body

CODE:
PHP код:
public OnGameModeInit()
{
    
CreateActor (294,2501.1829,-1657.0374,13.4034,155.4148); 
Do i need something to do with?:
PHP код:
SetActorFacingAngle 



Re: Actor question - iLearner - 12.09.2018

try freezing him maybe? "TogglePlayerControllable".


Re: Actor question - KinderClans - 12.09.2018

Quote:
Originally Posted by iLearner
Посмотреть сообщение
try freezing him maybe? "TogglePlayerControllable".
TogglePlayerControllable works only with players.

@OP: Set a timer of 5 seconds to restore the actor in his original position.


Re: Actor question - iLearner - 12.09.2018

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
TogglePlayerControllable works only with players.

@OP: Set a timer of 5 seconds to restore the actor in his original position.
Did you try that sir.


Re: Actor question - KinderClans - 12.09.2018

TogglePlayerControllable funziona solo con i players perchй ha solo "playerid" come riferimento. Non c'и "actorid" in quel callback. Non c'и bisogno di provare, и cosi 🤔


Re: Actor question - DarknesS1988 - 12.09.2018

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
TogglePlayerControllable works only with players.

@OP: Set a timer of 5 seconds to restore the actor in his original position.
Could you explain me more about the timer which restore the actors in original positions . I'm asking this because i would like to have more than 1 actor.

PHP код:
 SetTimerEx("Timer"500false"d"playerid);




Re: Actor question - UFF - 12.09.2018

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
@OP: Set a timer of 5 seconds to restore the actor in his original position.
Timer? Actually, lots of timers = lag. It is not a good solution for this issue.

Anyways,

Try with applying animation to actor.

Код:
New Actor;
Actor = CreateActor(294,2501.1829,-1657.0374,13.4034,155.4148);  
ApplyActorAnimation(Actor, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0);



Re: Actor question - DarknesS1988 - 12.09.2018

Quote:
Originally Posted by UFF
Посмотреть сообщение
Timer? Actually, lots of timers = lag. It is not a good solution for this issue.

Anyways,

Try with applying animation to actor.

Код:
New Actor;
Actor = CreateActor(294,2501.1829,-1657.0374,13.4034,155.4148);  
ApplyActorAnimation(Actor, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0);
Thanksss!!! Works like a charm