Ghost Mode SPAWN
#1

I want to ask what's the best way to make a race spawn with ghost mode enabled and it's a single lane spawn | ^ | Like all vehicles get spawned on same place. So what would be best way to make it perfect spawns without damages and more. If player leave his vehicle what then? What if player leaves the server. ... all that.
Reply
#2

Have the vehicles spawn above the starting point.

pawn Код:
PutPlayerInVehicle(playerid, CreateVehicle(model, x, y, z + 5.0, angle, 0, 0, -1, 0), 0);
DisableRemoteVehicleCollisions(playerid, 1);
Where 'model', 'x', 'y', 'z' and 'angle' represent the vehicle model ID, X, Y, Z float and facing angle respectively.

This way, the vehicle falls in to place and is less likely to highly impact on the players below. You could increase the range a little, but an offset too high may result in damage to the vehicle or may cause the vehicle to flip.

Player leaves the vehicle? Respawn/destroy the vehicle and respawn the player. Player leaves the server? Delete/respawn the last vehicle they were in if they were participating in the race.
Reply
#3

But for doing that i'll need to assign a variable to that vehicle but wouldn't this code land vehicle before player spawns is taken in it?
Код:
veh[playerid]=CreateVehicle(model, x, y, z + 5.0, angle, 0, 0, -1, 0);
PutPlayerInVehicle(playerid, veh[playerid], 0);
DisableRemoteVehicleCollisions(playerid, 1);
Reply
#4

It depends on the latency between the player and the server. A regular ping of 250 or below should have no trouble with this spawn. You don't need a variable for the vehicle in this situation. CreateVehicle returns the vehicle ID. Unless you plan on using this vehicle ID in the future.
Reply
#5

Or you could first spawn car at other locations, far from race and its course, detect when player is successfully in car by OnPlayerStateChange then use SetVehcilePos.
Reply
#6

Pretty nice idea
Reply
#7

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
Or you could first spawn car at other locations, far from race and its course, detect when player is successfully in car by OnPlayerStateChange then use SetVehcilePos.
A.K.A. "Car Pool"

:3

But seriously, hold a group a vehicles to the side that you can use when you need them. I usually do this anyways for certain things. Creating vehicles can be very slow!
Reply
#8

I just tried and the first way is best Slower the better in this case i guess.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)