How to alternate between 2 locations
#1

Hey,
How can i get a vehicle spawn (from dealership) to alternate between two different cords?

pawn Код:
GrottiVehicleSpawnLoc()
{
      533.1320,-1316.8053,16.9984,92.6
      537.8416,-1321.7615,16.9943,92.6
}
Reply
#2

explain a bit more please? i dont understand you
Reply
#3

pawn Код:
new Float:GrottiVehicleSpawnLoc[2][4] = {
{533.1320,-1316.8053,16.9984,92.6},
{537.8416,-1321.7615,16.9943,92.6}
};

CreateVehicle(522,GrottiVehicleSpawnLoc[0][0],GrottiVehicleSpawnLoc[0][1],GrottiVehicleSpawnLoc[0][2]GrottiVehicleSpawnLoc[0][3],-1,-1,-1);
Reply
#4

pawn Код:
new spawnIdx; // Global variable, used to determin last spawned index

new Float:VehicleSpawnLocs[2][3] =
{
      {533.1320,-1316.8053,16.9984,92.6},
      {537.8416,-1321.7615,16.9943,92.6}
};

stock GrottiSpawnVehicle(Your Params Here)
{
    if(spawnIdx > sizeof(VehicleSpawnLocs))
    {
        spawnIdx = 0;
    }
    else
    {
        spawnIdx++;
    }
    new Float:x = VehicleSpawnLocs[spawnIdx][0],
    Float:y = VehicleSpawnLocs[spawnIdx][1],
    Float:z = VehicleSpawnLocs[spawnIdx][2];
    CreateVehicle(...)
}
Something like that
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)