pickup
#2

Quote:
Originally Posted by suni
Посмотреть сообщение
i need help with this pickup code.


when i created a pickup, it doesnt create in front of me, it create under me. i want it to create in front of me when i create one but i cant get this code edit. please help me.
pawn Код:
new
    Float: pPos[4],    
    Float: dPos[3],
    distanceFromPlayer = 1
;

// pPos - player's position,
// dPos - destination position
// distanceFromPlayer - some variable, adjust it for yourself.

GetPlayerPos(
                playerid,
                pPos[0], pPos[1], pPos[2]
);

GetPlayerFacingAngle(
                playerid,
                pPos[3]
);
pPos[3] = 360 - pPos[3];

dPos[0] = pPos[0] + distanceFromPlayer * floatsin( pPos[3], degrees );  // x coordinate
dPos[1] = pPos[1] + distanceFromPlayer * floatcos( pPos[3], degrees );  // y coordinate
dPos[2] = pPos[2] + 0.35;                                               // z coordinate
dPos[] contains coordinates in front of You (1 unit away).

The rest is piece of cake.

Greetings
Reply


Messages In This Thread
pickup - by suni - 22.03.2015, 14:16
Re: pickup - by LetsOWN[PL] - 22.03.2015, 14:30
Respuesta: pickup - by alexus - 22.03.2015, 14:33
Re: Respuesta: pickup - by suni - 22.03.2015, 15:59
Respuesta: pickup - by alexus - 22.03.2015, 17:28

Forum Jump:


Users browsing this thread: 1 Guest(s)