stock Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
switch(IsPlayerInAnyVehicle(playerid))
{
case 0: GetPlayerFacingAngle(playerid, a);
case 1: GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
Használata new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetPosInFrontOfPlayer(playerid, X, Y, 10.0);
CreateVehicle(411, X, Y, Z, 0.0, 0, 0, -1);