Posts: 316
Threads: 61
Joined: Jul 2012
Reputation:
0
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?
Posts: 340
Threads: 12
Joined: May 2011
Reputation:
0
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.
Posts: 340
Threads: 12
Joined: May 2011
Reputation:
0
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.