Create Object Behind Vehicle
#1

Hello Community,
im searching for an Solution:

How can i Create a Object behind a Dune ?
So its wayne if i stay to North or S ?

I tryed it abit but failed
can someone help me ?
It's for a Lazeret Script

pawn Код:
stock CreateLazeret(playerid, Float:vehiclelength)
{
    new Float:x,Float:y,Float:z,Float:a;
    new vID = GetPlayerVehicleID(playerid);
    GetVehiclePos(vID, x, y, z);
    GetPlayerFacingAngle(vID, a);
    x += (vehiclelength* floatsin(-a, degrees));
    y += (vehiclelength* floatcos(-a, degrees));
    Object = CreateDynamicObject(1997, x, y-5.5, z-2.20, 0.0, 0.0, a, 0, 0);
    //return IsPlayerInRangeOfPoint(playerid,radius,x,y,z);
    return 1;
}
Reply
#2

Try replace
pawn Код:
x += (vehiclelength* floatsin(-a, degrees));
y += (vehiclelength* floatcos(-a, degrees));
With
pawn Код:
x -= (vehiclelength* floatsin(-a, degrees));
y -= (vehiclelength* floatcos(-a, degrees));
Reply
#3

Not working. Someone else has an idea ?
Reply
#4

pawn Код:
stock CreateLazeret(playerid, Float:vehiclelength)
{
    new Float:x, Float:y, Float:z, Float:angle, vID = GetPlayerVehicleID(playerid),
        Float:sX, Float:sY, Float:sZ;
    GetVehiclePos(vID, x, y, z);
    GetPlayerFacingAngle(vID, angle);
    GetVehicleModelInfo(GetVehicleModel(vID), VEHICLE_MODEL_INFO_SIZE, sX, sY, sZ);
    sY /= 1.7;
    y += (sY * floatcos(-angle, degrees));
    Object = CreateDynamicObject(1997, x, y, z - 2.20, 0.0, 0.0, a, 0, 0);
    //return IsPlayerInRangeOfPoint(playerid,radius,x,y,z);
    return 1;
}
Reply
#5

Not working - if i stand too North it wont works but if i stand too Sudth it works

any other ideas please?

i need it
Reply
#6

What you mean that doesn't work?? tell me exactly what you want.
Reply
#7

I want it so:
If i type a Command -> And Object Spawns Behind the Dune (like a Container) ->
The object is to always stand behind the dune, no matter which way I am.
The code is up to now only if I am in the north, but I do not know why

@****** Translator - Sorry - Hope you know what i mean
Reply
#8

pawn Код:
stock CreateLazeret(playerid, Float:vehiclelength)
{
    new Float:x, Float:y, Float:z, Float:angle, vID = GetPlayerVehicleID(playerid),
        Float:sX, Float:sY, Float:sZ;
    GetVehiclePos(vID, x, y, z);
    GetPlayerFacingAngle(vID, angle);
    GetVehicleModelInfo(GetVehicleModel(vID), VEHICLE_MODEL_INFO_SIZE, sX, sY, sZ);
    sX /= 2.0;
    sY /= 1.7;
    x += (sX * floatsin(-angle, degrees));
    y += (sY * floatcos(-angle, degrees));
    Object = CreateDynamicObject(1997, x, y, z - 2.20, 0.0, 0.0, a, 0, 0);
    //return IsPlayerInRangeOfPoint(playerid,radius,x,y,z);
    return 1;
}
try that
Reply
#9

This one doesnt works too -.-
Reply
#10

Bump - still need it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)