GetDynamicObjectPos & OnPlayerShootDynamicObject reading wrong coordinates
#1

Hi everyone,

I have problem with GetDynamicObjectPos and OnPlayerShootDynamicObject which are not getting coordinates right. I spent few hours trying to find solution but without any luck so I was hopping you guys can help me. You can see at the picture below that script is clearly getting coordinates and distance between player and object wrong.

This is object I created.
pawn Код:
CreateDynamicObject(19315, 1227.5359, -4454.4858, 23.4837,   0.00000, 0.00000, 0.00000, -1, -1, -1, 300.00, 300.00);
This is a code from script.
pawn Код:
public OnPlayerShootDynamicObject(playerid, weaponid, objectid, Float:x, Float:y, Float:z)
{
    new
        Float: fDistance = GetPlayerDistanceFromPoint(playerid, x, y, z),
        sString[256],
        sString2[256];
       
    format(sString, sizeof(sString), "Weapon %i. Object: %i. Pos of Object: %f, %f, %f", weaponid, objectid, x, y, z);
    format(sString2, sizeof(sString2), "Distance between you and Object is %0.2f.", fDistance);
    SendClientMessage(playerid, -1, sString);
    SendClientMessage(playerid, 0xA9C4E4FF, sString2);
    return 1;
}
Any help would be appreciated.
Reply


Messages In This Thread
GetDynamicObjectPos & OnPlayerShootDynamicObject reading wrong coordinates - by Fmfan - 02.04.2019, 13:12
Re: GetDynamicObjectPos & OnPlayerShootDynamicObject reading wrong coordinates - by NaS - 02.04.2019, 13:35
Re: GetDynamicObjectPos & OnPlayerShootDynamicObject reading wrong coordinates - by Fmfan - 02.04.2019, 13:46
Re: GetDynamicObjectPos & OnPlayerShootDynamicObject reading wrong coordinates - by RedFusion - 02.04.2019, 16:34

Forum Jump:


Users browsing this thread: 1 Guest(s)