SA-MP Forums Archive
About 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: About actors (/showthread.php?tid=644203)



About actors - AlexMSK - 05.11.2017

Hello, is there possible to make something like

PHP код:
#include <foreach>
new ActorCJ[6];
public 
OnGameModeInit()
{
ActorCJ[0] = CreateActor(00.00.03.00.0);
ActorCJ[1] = CreateActor(00.00.03.00.0);
ActorCJ[2] = CreateActor(00.00.03.00.0);
ActorCJ[3] = CreateActor(00.00.03.00.0);
ActorCJ[4] = CreateActor(00.00.03.00.0);
ActorCJ[5] = CreateActor(00.00.03.00.0);
ActorCJ[6] = CreateActor(00.00.03.00.0);
for(new 
06++) {
    
ApplyActorAnimation(i"DEALER""DEALER_IDLE"4.0100001);
}
return 
1;

??


Re: About actors - AlexMSK - 05.11.2017

bump anyone?


Re: About actors - Dayrion - 05.11.2017

Did you tried?


Re: About actors - TomRedlake - 05.11.2017

Код:
#MAX_ACTORS 6
Try adding these and replace:
Код:
for(new i; i < MAX_ACTORS; i++) { 
    ApplyActorAnimation(i, "DEALER", "DEALER_IDLE", 4.0, 1, 0, 0, 0, 0, 1); 
}



Re: About actors - Mencent - 05.11.2017

Hello!

When you want to do this, then like this:
PHP код:
#include <foreach> 
new ActorCJ[7]; 
public 
OnGameModeInit() 

ActorCJ[0] = CreateActor(00.00.03.00.0); 
ActorCJ[1] = CreateActor(00.00.03.00.0); 
ActorCJ[2] = CreateActor(00.00.03.00.0); 
ActorCJ[3] = CreateActor(00.00.03.00.0); 
ActorCJ[4] = CreateActor(00.00.03.00.0); 
ActorCJ[5] = CreateActor(00.00.03.00.0); 
ActorCJ[6] = CreateActor(00.00.03.00.0); 
for(new 
07++) { 
    
ApplyActorAnimation(i"DEALER""DEALER_IDLE"4.0100001); 

return 
1

Because you use 0-6 (0,1,2,3,4,5,6 = 7) but you defined it with 6. I hope you understand what I mean. ^^


Re: About actors - AjaxM - 05.11.2017

PHP код:

#define MAX_ACTORS 7
new ActorCJ[MAX_ACTORS]; 
public 
OnGameModeInit() 

    
ActorCJ[0] = CreateActor(00.00.03.00.0); 
    
ActorCJ[1] = CreateActor(00.00.03.00.0); 
    
ActorCJ[2] = CreateActor(00.00.03.00.0); 
    
ActorCJ[3] = CreateActor(00.00.03.00.0); 
    
ActorCJ[4] = CreateActor(00.00.03.00.0); 
    
ActorCJ[5] = CreateActor(00.00.03.00.0); 
    
ActorCJ[6] = CreateActor(00.00.03.00.0); 
    for(new 
0MAX_ACTORS++) 
    { 
        
ApplyActorAnimation(i"DEALER""DEALER_IDLE"4.0100001); 
    } 
    return 
1

Though, you won't need foreach for this loop.


Re: About actors - Sasino97 - 07.11.2017

ApplyActorAnimation(ActorCJ[i], "DEALER", "DEALER_IDLE", 4.0, 1, 0, 0, 0, 0, 1);