08.09.2011, 18:24
(
Last edited by judothijs; 10/09/2011 at 03:32 PM.
)
Use SetVehiclePos(vehicleid, Float:X, Float:Y, Float:Z); to put the car at the dealership.
Use a loop trough all the vehicles and get their position and then compare that position to the position of the dealership, if true, use SetVehiclePos, but then with different cords.
Example for the loop:
Now simply put the bool CarAtDealership before the SetVehiclePos in your command, and fill in your cords
Use a loop trough all the vehicles and get their position and then compare that position to the position of the dealership, if true, use SetVehiclePos, but then with different cords.
Example for the loop:
pawn Code:
new bool CarAtDealerShip[MAX_VEHICLES] = false; // somewhere on top of your script.
for(i = 0; i < MAX_VEHICLES; i++) // Looping trough all the vehicles in the server.
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(i, Float:X, Float:Y, Float:Z);
if(Float:X == Your_Cord && Float:Y == Your_Cord && Float:Z == Your_Cord)
{
CarAtDealership[i] = true;
}
else
{
CarAtDealership[i] = false;
}
}