SA-MP Forums Archive
A 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: A Question ! (/showthread.php?tid=620433)



A Question ! - TYDS - 30.10.2016

Hello !
Код:
new Actor[20];
Код:
Actor[0] = CreateActor(155,-1719.7705,1362.9010,7.1875,81.5402);
	Actor[1] = CreateActor(16,-1560.4667,127.7196,3.5547,126.5390); 
	Actor[2] = CreateActor(8,-2032.6766,143.6468,28.8359,257.2235); 
	Actor[3] = CreateActor(61,-1980.8951,132.9629,27.6875,104.6522); // 
	Actor[4] = CreateActor(29,-2623.4158,209.3259,4.6826,1.8958); // 
	Actor[5] = CreateActor(60,1366.1343,-1275.1068,13.5469,75.4141); // 
	Actor[6] = CreateActor(66,2165.2283,-1674.6619,15.0859,235.1924); // 
	Actor[7] = CreateActor(105,2227.3223,-1717.8156,13.5121,83.5844); // 
	Actor[8] = CreateActor(112,2195.7766,-1973.1979,13.5589,191.0588); // 
	Actor[9] = CreateActor(113,2354.2490,-1169.6031,28.0223,11.8538); // 
	Actor[10] = CreateActor(61,1741.2861,-1863.6543,13.5748,353.0536); // 
	Actor[11] = CreateActor(117,-2269.4607,-158.1773,35.3203,285.0831); // 
	Actor[12] = CreateActor(249,1125.6121,-1483.1138,22.7690,181.5192); // 
	Actor[13] = CreateActor(228,1477.1990,-1772.1451,18.7958,359.4007); // 
	Actor[14] = CreateActor(121,2072.8926,-1835.3344,13.5469,270.0040); //
        Actor[15] = CreateActor(.......);
I want to ask that how can i make each every 1 minute Actor 15 will random spawm in some locaion i make !


Re: A Question ! - ISmokezU - 30.10.2016

I'm tired but i'll do this for you.

PHP код:
new Float:ActorPositions[][] = {
   {
X,Y,Z,Facing Angle},
   {},
//etc
   
{}//etc (Remove the , off the last one)
};
public 
OnGameModeInit()
{
SetTimer("ActorPos",60000,true);
return 
1;
}
forward ActorPos();
public 
ActorPos()
{
new 
random(sizeof(ActorPositions));
SetActorPos(Actor[15],ActorPositions[r][0],ActorPositions[r][1],ActorPositions[r][2]);
SetActorFacingAngle(Actor[15],ActorPositions[0][3]);
return 
1



Re: A Question ! - TYDS - 30.10.2016

thank you very much