Samp actor bug
#1

How can I set animation only for 1 actor ? Currently is set to 3 actors from 4. I want only 1 actor

PHP код:
Ongamemodeinit
     CreateActor
(287,-217.9552984.932919.5446275.5176);
     
CreateActor(287,111.18241026.490813.60940.4583);
     
CreateActor(287,573.6483,1221.2623,11.7113,208.7048);
     
CreateActor(287257.3131,1404.7999,10.5183,264.1653);
public 
OnActorSpawn(actorid)
{
    for(new 
iactoridi++)
    {
        
ApplyActorAnimation(actorid"WUZI""CS_Dead_Guy"4.101110);
        
SetActorInvulnerable(actoridtrue);
    }
    return 
1;

Reply
#2

Well the problem is that you loop through all of the actors and give them this animation instead of giving it to just one actor.

You can probably make an array that will contain all of the actor ids, so that you can easily know which actor you are working with and then make them do whatever you want.

PHP код:
#define MAX_ACTORS 4 //you can adjust this number to how much actors you will be using
new ActorsMAX_ACTORS ]; //this is the array that will store their ids
Actors] = CreateActor.....  //this is where you create the actors
Actors] = CreateActor.....
public 
OnActorSpawn(actorid)
{
    if ( 
actorid == Actors] ) //assign this specific actor to do something
    
{
        
ApplyActorAnimation(actorid"WUZI""CS_Dead_Guy"4.101110); 
        
SetActorInvulnerable(actoridtrue); 
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)