stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
So und das verwendest du dann so:
dcmd_v(playerid,params[])
{
if(gAdmin[playerid]<2)
{
return SendClientMessage(playerid,COLOR_RED,"Du bist kein Admin oder dein Admin-Rang ist zu niedrig!");
}
new vID;
if(sscanf(params, "d", vID))
{
return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /v [Vehicle ID]");
}
if(vID < 400 || vID > 611)
{
return SendClientMessage(playerid,COLOR_RED,"Nur Vehicle-ID's von 400-611 benutzen!");
}
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
CreateVehicle(vID, x, y, z+1, 0, 0xFFFFFFFF, 0xFFFFFFFF, 999999999999999999999999999999999999999);
new string[256];
format(string, sizeof(string), "Erfolgreich Vehicle ID %d gespawnt.", vID);
SendClientMessage(playerid, COLOR_GREEN, string);
}
return 1;
}
Müsste klappen. Wenn ich das richtig verstanden habe.