
CMD:veh(playerid, params[])
{
new vehid, float:x, float:y, float:z;
if(sscanf(params, "i", vehid)) return SendClientMessage(playerid, -1, "[USAGE]: /veh [vehid]");
GetPlayerPos(playerid, x, y, z);
CreateVehicle(vehid, x+3.0, y, z, 0.0, 0, 0, 0);
return 1;
}
CMD:veh(playerid, params[])
{
new vehid;
if (sscanf(params, "i", vehid)) {
SendClientMessage(playerid, -1, "[USAGE]: /veh [vehid 400 - 611]");
return 1;
}
if (vehid < 400 || vehid > 611) {
SendClientMessage(playerid, -1, "[USAGE]: /veh [vehid 400 - 611]");
return 1;
}
new Float:x, Float:y, Float:z, Float:a, Float:tA;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
tA = a < 270.0 ? a + 90.0 : a - 270.0;
CreateVehicle(vehid, x + (floatsin(-a, degrees) * 5.0), y + (floatcos(-a, degrees) * 5.0), z, tA, 0, 0, 0);
return 1;
}
|
When the vehicle spawns in front of you, it'll be facing to the left - meaning the driver door will be facing you.
|
xD ty for all that thoughCMD:veh(playerid, params[])
{
new vehid;
if (sscanf(params, "i", vehid)) {
SendClientMessage(playerid, -1, "[USAGE]: /veh [vehid 400 - 611]");
return 1;
}
if (vehid < 400 || vehid > 611) {
SendClientMessage(playerid, -1, "[USAGE]: /veh [vehid 400 - 611]");
return 1;
}
new Float:x, Float:y, Float:z, Float:a, Float:tA, vid;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
tA = a < 270.0 ? a + 90.0 : a - 270.0;
vid = CreateVehicle(vehid, x + (floatsin(-a, degrees) * 5.0), y + (floatcos(-a, degrees) * 5.0), z, tA, 0, 0, 0);
SetVehicleVirtualWorld(vid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
return 1;
}

CMD:veh(playerid, params[])
{
new vehid, float:x, float:y, float:z;
if(sscanf(params, "i", vehid)) return SendClientMessage(playerid, -1, "[USAGE]: /veh [vehid]");
GetPlayerPos(playerid, x, y, z);
CreateVehicle(vehid, x+3.0, y, z, 0.0, 0, 0, 0);
return 1;
}
new vehid, float:x, float:y, float:z;
new vehid, Float:x, Float:y, Float:z;