Ghost Mode SPAWN - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ghost Mode SPAWN (
/showthread.php?tid=602518)
Ghost Mode SPAWN -
AroseKhanNiazi - 08.03.2016
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.
Re: Ghost Mode SPAWN -
Threshold - 08.03.2016
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.
Re: Ghost Mode SPAWN -
AroseKhanNiazi - 08.03.2016
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);
Re: Ghost Mode SPAWN -
Threshold - 08.03.2016
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.
Re: Ghost Mode SPAWN -
BroZeus - 08.03.2016
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.
Re: Ghost Mode SPAWN -
AroseKhanNiazi - 08.03.2016
Pretty nice idea
Re: Ghost Mode SPAWN -
Crayder - 08.03.2016
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!
Re: Ghost Mode SPAWN -
AroseKhanNiazi - 08.03.2016
I just tried and the first way is best
Slower the better in this case i guess.