How can i spawn a specific player in a specific vehicle ?
#1

How can i spawn a specific player in a specific vehicle ? Or like hte soldier in a tank and the tero in a car ? I hope i get help . Thank You !
Reply
#2

We need a vehicle
pawn Код:
CreateVehicle(modelif, x.x, y.y, z.z, a.a, color1, color2, respawn_delay);
With this one you put players in created vehicles.
pawn Код:
PutPlayerInVehicle(playerid, v1, 0); // playerid == player, v1 == vehicle, 0 == seatid
Reply
#3

Quote:
Originally Posted by SAWC™
We need a vehicle
pawn Код:
CreateVehicle(modelif, x.x, y.y, z.z, a.a, color1, color2, respawn_delay);
With this one you put players in created vehicles.
pawn Код:
PutPlayerInVehicle(playerid, v1, 0); // playerid == player, v1 == vehicle, 0 == seatid
so u meant i put hte vehicle id to the model and the coordiantes , and the to put the player there , i have to put hte skin id ?
Reply
#4

so waht can i do?
Reply
#5

Skin id? YOU PUT THE SEAT ID.

Right, at the top of your script, put this:
pawn Код:
new spawncar;
Then in OnGameModeInit, put this:
pawn Код:
spawncar = CreateVehicle(ModelID, COORD X, COORD Y, COORD Z, COORD A, Car Color 1, Car Color 2, 1);
To find the modelid, go here:
https://sampwiki.blast.hk/wiki/Category:Vehicle
To find the Car Colors 1 and 2, go here:
https://sampwiki.blast.hk/wiki/Color_ID

Then, in OnPlayerSpawn, put this:
pawn Код:
PutPlayerInVehicle(playerid,spawncar,1);
Reply
#6

Quote:
Originally Posted by jameskmonger
Skin id? YOU PUT THE SEAT ID.

Right, at the top of your script, put this:
pawn Код:
new spawncar;
Then in OnGameModeInit, put this:
pawn Код:
spawncar = CreateVehicle(ModelID, COORD X, COORD Y, COORD Z, COORD A, Car Color 1, Car Color 2, 1);
To find the modelid, go here:
https://sampwiki.blast.hk/wiki/Category:Vehicle
To find the Car Colors 1 and 2, go here:
https://sampwiki.blast.hk/wiki/Color_ID

Then, in OnPlayerSpawn, put this:
pawn Код:
PutPlayerInVehicle(playerid,spawncar,1);

i did it and the player does spawn at the vehicle , but the only thing wrong is htat , the car doesnt move , doesnt respond , or anything. .. and another thing is when u get out of the car , the game crashes, now can u do anything about it ?
Reply
#7

Quote:
Originally Posted by jameskmonger
Skin id? YOU PUT THE SEAT ID.

Right, at the top of your script, put this:
pawn Код:
new spawncar;
Then in OnGameModeInit, put this:
pawn Код:
spawncar = CreateVehicle(ModelID, COORD X, COORD Y, COORD Z, COORD A, Car Color 1, Car Color 2, 1);
To find the modelid, go here:
https://sampwiki.blast.hk/wiki/Category:Vehicle
To find the Car Colors 1 and 2, go here:
https://sampwiki.blast.hk/wiki/Color_ID

Then, in OnPlayerSpawn, put this:
pawn Код:
PutPlayerInVehicle(playerid,spawncar,1);
pawn Код:
PutPlayerInVehicle(playerid,spawncar,1);
Puts the player in a passenger seat. Try this:

pawn Код:
PutPlayerInVehicle(playerid,spawncar,0);

Reply
#8

Oh, I thought 1 was driver xDD
Reply
#9

and another thing , look how to make the healht of the vehicle shown as the health as the player , and how to make the player die when exites th vehicle , and how to make a new player class no the first one , but a new one in a different vehicle ? not the same skin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)