Help for script
#5

if you meant that if an actor is being spawned?
PHP код:
//actor variable
new Actor[MAX_ACTOR]; //assuming you have set the MAX_ACTOR to a ideal number 
PHP код:
//Place this on gamemodinit
Actor[0] = CreateActor(01605.82201829.062510.52514.3929//spawns actor CJ infront of Las Venturas Hospital 
you won't need to get the actors position coz it will spawn on your specified location.
but
if you meant that if an actor is moved, by i.e players, objects, or bullet?
PHP код:
//Place this somewhere when you try to update the actors, i.e timers, callbacks, etc
new Float:axFloat:ayFloat:azFloat:angle;
GetActorPos(Actor[0], axayaz);
GetActorFacingAngle(Actor[0], angle);
if(
ax != 1605.8220 || ay != 1829.0625//or you could add Z, which is not ideal since a little movement on the ground changes the actors x and y axis
SetActorPos(actorid1605.82201829.062510.5251); //respawns actor CJ infront of Las Venturas Hospital
SetActorFacingAngle(Actor[0], 4.3929); 
This will keep the actor teleported back to it's location every time the timer reaches its interval or when you update each actor on the server. In theory

NOTE:
I don't know if there is somewhat a function like
PHP код:
AddStaticVehicleEx(modelidFloat:spawn_xFloat:spawn_yFloat:spawn_zFloat:z_anglecolor1color2respawn_delayaddsiren=0); 
That respawns the actor at a given time.
Reply


Messages In This Thread
Help for script - by monisoft - 15.02.2017, 21:26
Re: Help for script - by monisoft - 16.02.2017, 10:56
Re: Help for script - by JesterlJoker - 16.02.2017, 11:18
Re: Help for script - by monisoft - 16.02.2017, 11:25
Re: Help for script - by JesterlJoker - 16.02.2017, 14:17
Re: Help for script - by monisoft - 17.02.2017, 10:09
Re: Help for script - by monisoft - 17.02.2017, 21:29
Re: Help for script - by monisoft - 18.02.2017, 21:48

Forum Jump:


Users browsing this thread: 2 Guest(s)