Spawn a whole team?
#1

i have 2 teams for my car football gamemode.. and after every goal i need the cars respawn at their usual places [DONE] but also i need the team members respawn at their places.. cuz what happens is the car respawns and the guy in it just as if he was ejected.. so any help?
Reply
#2

Instead of respawning the cars, set their position to their spawnpoint. When respawning a car, the possible passengers inside will be ejected, but when setting a vehicle's position, the passengers will teleport with the car.

Also you could hook it up to OnVehicleSpawn and put the players inside the cars once the cars have respawned.
Reply
#3

Quote:
Originally Posted by [FSaF]Jarno
Посмотреть сообщение
Instead of respawning the cars, set their position to their spawnpoint. When respawning a car, the possible passengers inside will be ejected, but when setting a vehicle's position, the passengers will teleport with the car.

Also you could hook it up to OnVehicleSpawn and put the players inside the cars once the cars have respawned.
Hooking it up there will be hard... cuz the server wont be knowing which vehicle takes which player.. thanks for the idea.. i will try this but i need to stick more to what i asked up there
Reply
#4

Make a variable to your script, called something like FootballCarPlayer[MAX_VEHICLES]
When the round starts and the players are put into their vehicles, you store the playerid in the variable
PutPlayerInVehicle(playerid,FootballVehicle);
FootballCarPlayer[FootballVehicle] = playerid;

and on OnVehicleRespawn, put in

PutPlayerInVehicle(vehicleid,FootballCarPlayer[vehicleid],0);


It's simple, really.

EDIT: Note that FootballVehicle is the vehicle that you use in your football script, i just named it footballvehicle for reference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)