Force player into car
#1

Whats the code to force the player into a car?
i need for my spawn car command
the car spwans from the player at X:0 Y:10 Z:=playeridZ

thanks
Reply
#2

pawn Код:
PutPlayerInVehicle(vehicleid, playerid, seatid);
0 is driver
1 is front passenger
2 & 3 are the back two seats (if available)
Reply
#3

thanks

just one more qustion how whould i put this in to this
Код:
	if(strcmp(cmd, "/yadayada", true) == 0) {
 	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	CreateVehicle(520, x, y, z, 82.2873, 0, 1, 60);

  	return 1;
	}
Reply
#4

Quote:
Originally Posted by kylebrown
thanks

just one more qustion how whould i put this in to this
Код:
	if(strcmp(cmd, "/yadayada", true) == 0) {
 	new Float:x, Float:y, Float:z, vehicle;
	GetPlayerPos(playerid, x, y, z);
	vehicle = CreateVehicle(520, x, y, z, 82.2873, 0, 1, 60);
PutPlayerInVehicle(vehicle, playerid, 0);
  	return 1;
	}
Reply
#5

Thanks
need that code

EDIT: its not working, it just spwans the hydra on my head!
Код:
	if(strcmp(cmd, "/Hydra", true) == 0) {
 		new Float:x, Float:y, Float:z, vehicle;
		GetPlayerPos(playerid, x, y, z);
		vehicle = CreateVehicle(520, x, y, z, 82.2873, 0, 1, 60);
		PutPlayerInVehicle(vehicle, playerid, 0);
	return 1;
	}
Reply
#6

Try this:

pawn Код:
if(strcmp(cmd, "/Hydra", true) == 0)
{
  new Float:x, Float:y, Float:z, vehicle;
  GetPlayerPos(playerid, x, y, z);
  PutPlayerInVehicle(playerid,CreateVehicle(520, x, y, z, 82.2873, 0, 1, 60),0);
  return 1;
}
Reply
#7

Quote:
Originally Posted by lolumadd [cod5server.tk
]
pawn Код:
PutPlayerInVehicle(vehicleid, playerid, seatid);
0 is driver
1 is front passenger
2 & 3 are the back two seats (if available)
4 is the next available seat.
Reply
#8

thanks and it work! yay

How do you stop the hydra from respawning? without useing
Код:
public OnPlayerExitVehicle
     new currentveh;
     currentveh = GetPlayerVehicleID(playerid);
     DestroyVehicle(currentveh);
Reply
#9

bumpz, please need help
Reply
#10

Quote:
Originally Posted by kylebrown
thanks and it work! yay

How do you stop the hydra from respawning? without useing
Код:
public OnPlayerExitVehicle
     new currentveh;
     currentveh = GetPlayerVehicleID(playerid);
     DestroyVehicle(currentveh);
Use OnVehicleDeath? Store the vehicleid when you create it and when it dies Destroy it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)