Alright let me explain this
First we need a command to explain it better
pawn Код:
new car; //on top of script
if(strcmp(cmdtext, "/car", true,4) == 0)
{
return 1;
}
This is an empty command . Now we make some Floats
pawn Код:
if(strcmp(cmdtext, "/car", true,4) == 0)
{
new Float:X,Float:Y,Float:Z,Float:A;
return 1;
}
Now we will use the floats
pawn Код:
if(strcmp(cmdtext, "/car", true,4) == 0)
{
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,A);
Car = CreateVehicle(X,Y,Z,A,1,1);
return 1;
}
Now that we have created a vehicle and a command , now we can use the function
pawn Код:
if(strcmp(cmdtext, "/car", true,4) == 0)
{
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,A);
Car = CreateVehicle(411,X,Y,Z,A,1,1);
PutPlayerInVehicle(playerid,Car,0);
return 1;
}
This will put the player in the vehicle spawned as soon as it spawns .. I hope this explains it .. Ask if this doesnt explain