Make a Spawn Position follow a pattern -
caribe88 - 30.03.2012
Hello, Ok my question is the following, I would like to make different positions where if the pos1, continue to pos2 like a loop, I'm not looking for random position y would like that the script follows a pattern is that possible?
Right now I'm using random pos and cars get stacked on top of each other when they enter a derby for example.
In advance thanks for the help
Re: Make a Spawn Position follow a pattern -
Deduction - 30.03.2012
Well yes it is possible, my thought was with having a Variable and it starts off at 0 like so:
Then when Spawn a car, you would use for example:
pawn Код:
if(SpawnPos == 0)
{
//Spawncar on X Y Z
SpawnPos = 1;
return 1;
}
else if(SpawnPos == 1)
{
//Second Car Spawn
SpawnPos = 2;
return 1;
}
Something like that, and just change the Coordinates for each car, then with the last car coordinate, instead of setting SpawnPos = Next Number
set it back to 0. like so:
SpawnPos = 0;
This would loop the Spawn.
Basic and easy.
Re: Make a Spawn Position follow a pattern -
caribe88 - 30.03.2012
I did it like this but it doesn't work how its supposed to be i will try you way lets see if that works
Код:
if(SetSpawnCord == 0){
SetSpawnCord++;
Sumocars[playerid] = CreateVehicle(Sumocarspawn[randcar],
-1388.7997,
1280.1909,
1040.2384+1,
161.9468,
-1,-1,600);
}
else if(SetSpawnCord == 1){
SetSpawnCord++;
Sumocars[playerid] = CreateVehicle(Sumocarspawn[randcar],
-1422.0255,
1267.3906,
1040.1133+1,
236.3466,
-1,-1,600);
}
else if(SetSpawnCord == 2){
SetSpawnCord++;
Sumocars[playerid] = CreateVehicle(Sumocarspawn[randcar],
-1430.5059,
1239.6534,
1040.2374+1,
269.1644,
-1,-1,600);
}
else if(SetSpawnCord == 2){
SetSpawnCord++;
Sumocars[playerid] = CreateVehicle(Sumocarspawn[randcar],
-1416.6099,
1216.5471,
1040.2363+1,
323.6594,
-1,-1,600);
}
else if(SetSpawnCord == 3){
SetSpawnCord++;
Sumocars[playerid] = CreateVehicle(Sumocarspawn[randcar],
-1375.0413,
1218.0331,
1040.23573+1,
40.4086,
-1,-1,600);
}
else if(SetSpawnCord == 4){
SetSpawnCord++;
Sumocars[playerid] = CreateVehicle(Sumocarspawn[randcar],
-1362.3585,
1255.6079,
1040.2421+1,
100.4724,
-1,-1,600);
}
Thank You Deduction
Edit: It worked very good This will be useful for couple events that i plan on doing in my server