06.05.2016, 14:18
Quote:
I want to do CreateVehicle Be4 That cmd and a new Vehicle pos will be GetPlayerPos Then SetVehiclePos I think it will be with New X Y Z it's back to GetPlayerPos then PutPlayerInVehicle.
I want to know how to +Rep u guys u helped me alot |
I misunderstood what you wanted.
Take a look :
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/tp", true) == 0) // If the player type /tp than we executes thos following lines
{
new Float:x, Float:y, Float:z, Float:Angle;
/* 4 variables : x, y, z, angle for create the vehicle at player's coordinate - 1 variable for the vehicle's model*/
GetPlayerPos(playerid, x, y, z);
/* We stock the position in differents variables (x, y, z) */
GetPlayerFacingAngle(playerid, Angle);
/* We stock the facing angle in the variable Angle*/
new vehicleid = CreateVehicle(411, x, y, z, Angle, -1, -1, 1000);
/* Replace 411 by the vehicle's model you want | -1 is a random color | Primary and secondary color
CreateVehicle(modelOfTheVehicle, Coordinate x, Coordinate y, Coordinate z, rotation of the vehicle, Primary color (-1 is random), Secondary color (-1 is random), respawn delay (in ms));
Link can be fin here : https://sampwiki.blast.hk/wiki/Vehicle_M...4.76242222
We create the vehicle at the player's coordinate */
PutPlayerInVehicle(playerid, vehicleid, 0);
/*We put the player in the vehicle at the seat 0. Why? Seat 0 = driver
0 - Driver
1 - Front passenger
2 - Back-left passenger
3 - Back-right passenger
4+ - Passenger seats (coach etc.)*/
SendClientMessage(playerid, COLOR_GREEN, "You have spawned an vehicle!"); // We send a basic message to say the player has been teleported
return 1;
}
return 0;
}

For +Rep someone, click on the star at the left bottom on a message.