Pickup opposite me
#1

Hello
How can i make if i type on example: /pickup when spawn a pickup but not on my coords, a pickup opposite with me +2 my coords. GetPlayerFacingAngle? or how?
Reply
#2

I think you're looking for this function.
pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{   // Created by ******

    new Float:a;

    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);

    if (GetPlayerVehicleID(playerid)) {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }

    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Reply
#3

/pickup

GetPlayerPos

CreatePickup(x+2
Reply
#4

pawn Код:
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
x += (2 * floatsin(-a,degrees));
y += (2 * floatsin(-a,degrees));
CreatePickup(modelid,x,y,z ....
Reply
#5

thank you good
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)