How to spawn a vehicle, 3 sec after teleporting. -
techg9 - 14.03.2011
oky,
so im using a streamer for all my server object, and i what to build some areas on the water, and when i build a area on the water and teleport to the area, all my vehicle that i spawn just drops to the water and after that the object create.
the vehicle spawn before the object.
so i think about this problem a lot, and i find a way to solve it, but when i don't know how to do this in the right method, so here i am, with this problem, and i can't make this script.
so if someone know how to do this, or have a little idea how to do this, PLEASE! post it here.
TNX FOR ALL THE HELPERS =)
Re: How to spawn a vehicle, 3 sec after teleporting. -
Kwarde - 14.03.2011
Try this: Give all the vehicles in that area an variable, eg.
pawn Код:
new stuntvehicle[5];
public OnGameModeInit()
{
stuntvehicle[0] = CreateVehicle...
stuntvehicle[1] = CreateVehicle...
// ETC.
return 1;
}
Then, when a player teleport set a timer (
SetTimer("respawnstuntvehicles", 3000, false);.
Then teleport all the unused vehicles (stuntvehicle)/
pawn Код:
forward respawnstuntvehicles();
public respawnstuntvehicles()
{
for(new i = 0; i < sizeof(stuntvehicle); i++)
for(new p = 0; p < MAX_PLAYERS; p++)
if(!IsPlayerInVehicle(p, stuntvehicle[i])
SetVehicleToRespawn(stuntvehicle[i]);
return 1;
}
Something like that.
Re: How to spawn a vehicle, 3 sec after teleporting. -
techg9 - 14.03.2011
this is a personal spawn or a public spawn?
i mean, if im in a teleport lest say "/race" and someone is teleporting to the same teleport, if im already there, i will see the vehicle spawn again?
Re: How to spawn a vehicle, 3 sec after teleporting. -
Sasino97 - 14.03.2011
yes xD,
I have another idea, try to increase vehicles's Z pos, so it'll fall from 5-6 metres and let the object stream correctly.
Example:
If you have:
CreateVehicle(model, etcc..., 154.1535, 1345.5612, 1254.5000, etc...);
You can increase 1254.5000 to 1258.5000, so I'll spawn a little bit on air, and the object will have time to spawn.
Re: How to spawn a vehicle, 3 sec after teleporting. -
techg9 - 14.03.2011
Quote:
Originally Posted by [GF]Sasino97
yes xD,
I have another idea, try to increase vehicles's Z pos, so it'll fall from 5-6 metres and let the object stream correctly.
Example:
If you have:
CreateVehicle(model, etcc..., 154.1535, 1345.5612, 1254.5000, etc...);
You can increase 1254.5000 to 1258.5000, so I'll spawn a little bit on air, and the object will have time to spawn.
|
can't work, becuse if i want to spawn a hydra, of any other aircraft vehicle, it will not spawn correctly and it could even blow up..
Re: How to spawn a vehicle, 3 sec after teleporting. -
techg9 - 15.03.2011
someone have a better idea??