pawn Код:
forward Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
new Float:x, Float:y, Float:z, Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
z + 2.0;
a + 90;
if(dialogid == 2 && response)
{
switch(listitem)
{
case 0:
{
CreateVehicle(515, x, y, z, a, 670, 60, 12000);
}
case 1:
{
CreateVehicle(515, x, y, z, a, 670, 60, 12000);
}
case 2:
{
CreateVehicle(515, x, y, z, a, 670, 60, 12000);
}
}
}
Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
else GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}