How do I spawn a vehicle infront of me? -
Coltmaster - 30.04.2013
For a command such as /car and it will spawn a PD cruiser infront of me?
Re: How do I spawn a vehicle infront of me? -
Pottus - 30.04.2013
Look at fsdebug.pwn and search for "dcmd_v" it's old but shows you everything you'll need
Re: How do I spawn a vehicle infront of me? -
RajatPawar - 30.04.2013
1) GetPlayerPos
2) new vehicle = CreateVehicle(..);
3) [OPTIONAL] PutPlayerInVehicle(vehicle, ..);
Simple!
Re: How do I spawn a vehicle infront of me? -
Coltmaster - 30.04.2013
I dont really understand step 2
Re: How do I spawn a vehicle infront of me? -
newbienoob - 30.04.2013
Quote:
Originally Posted by Rajat_Pawar
1) GetPlayerPos
2) new vehicle = CreateVehicle(..);
3) [OPTIONAL] PutPlayerInVehicle(vehicle, ..);
Simple!
|
Maybe you should read what he wanted.
How do I spawn a
vehicle infront of me?
Re: How do I spawn a vehicle infront of me? -
RajatPawar - 30.04.2013
Quote:
Originally Posted by newbienoob
Maybe you should read what he wanted.
How do I spawn a vehicle infront of me?
|
Maybe... you should read the [optional] sign.
At colt, CreateVehicle returns the ID of the vehicle created, so that you can tamper with that particular vehicle when you want. If you wanted yourself to be put in the car created, you would need the vehicleid, for which I suggested that.
Re: How do I spawn a vehicle infront of me? -
Coltmaster - 30.04.2013
Putting them straight in the vehicle would be fine, but how do I get the vehicle ID?
Re: How do I spawn a vehicle infront of me? -
NicholasA - 30.04.2013
Colt hit me up on skype
Re: How do I spawn a vehicle infront of me? -
newbienoob - 30.04.2013
Quote:
Originally Posted by Rajat_Pawar
Maybe... you should read the [optional] sign.
|
Quote:
Originally Posted by Rajat_Pawar
1) GetPlayerPos
2) new vehicle = CreateVehicle(..);
3) [OPTIONAL] PutPlayerInVehicle(vehicle, ..);
Simple!
|
That creates a vehicle ON TOP of player. NOT infront of player.
Btw, this would help
pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Re: How do I spawn a vehicle infront of me? -
RajatPawar - 30.04.2013
At newbienoob: Jesus, I was directing him. Who the hell uses that? Just put X + 2/Y+2/Z+2 or a combination like that!
When you use CreateVehicle somewhere, the returned ID can be assigned to a variable. That's why I put "new vehicleID = CreateVehicle..." there. It's okay if you don't use it. If you don't, it'll just spawn in front of you, but to put yourself into it directly would require the ID.