How to set another arrow on north? -
weex - 22.02.2017
I made this arrow:
Making this code:
Код:
if(InCheckPoint[i] == true) {
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(i,pX,pY,pZ);
for(new SID = 1; SID < MAX_CRIMES; SID++) {
SetObjectPos(GPSArrow[i][SID],pX, pY, pZ-1);
SetObjectRot(GPSArrow[i][SID],0,90,-90-AngleBetweenPoints(pX,pY,Xtargetpoint[i],Ytargetpoint[i]));
}
}
How to add more one arrow on north according to the arrow angle?
GPSArrow[i][1] = onplayer
GPSArrow[i][2] += 1.0 north
But it according with arrow angle?
Re: How to set another arrow on north? -
weex - 22.02.2017
I tried to add on Y but not work well...
I want add another arrow on north of last arrow direction
Anybody know this?
Re: How to set another arrow on north? -
BroZeus - 23.02.2017
This command creates 10 arrows one after another in player facing angle. Try it in game and combine its code with your.
PHP код:
CMD:arrow(playerid, params[])
{
new Float:pX,Float:pY,Float:pZ, Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid,pX,pY,pZ);
for(new i = 1; i < 10; i++) {
pX += floatmul(2, floatsin(-a, degrees));
pY += floatmul(2, floatcos(-a, degrees));
CreateObject(1318, pX, pY, pZ, 0, 90, 90-a);
}
return 1;
}
Re: How to set another arrow on north? -
rt-2 - 23.02.2017
Quote:
Originally Posted by BroZeus
This command creates 10 arrows one after another in player facing angle. Try it in game and combine its code with your.
PHP код:
CMD:arrow(playerid, params[])
{
new Float:pX,Float:pY,Float:pZ, Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid,pX,pY,pZ);
for(new i = 1; i < 10; i++) {
pX += floatmul(2, floatsin(-a, degrees));
pY += floatmul(2, floatcos(-a, degrees));
CreateObject(1318, pX, pY, pZ, 0, 90, 90-a);
}
return 1;
}
|
Quick look at this, why are you not using 'i' in your loop?
Its gonna make only one arrow, it's gonna go too fast I think
Re: How to set another arrow on north? -
BroZeus - 23.02.2017
Quote:
Originally Posted by blinkpnk
Quick look at this, why are you not using 'i' in your loop?
Its gonna make only one arrow, it's gonna go too fast I think
|
'i' was only needed if values were not being
added to pX and pY, see carefully that i wrote "pX
+=" So it keeps on adding distance in every iteration of loop
Re: How to set another arrow on north? -
rt-2 - 17.03.2017
Quote:
Originally Posted by BroZeus
'i' was only needed if values were not being added to pX and pY, see carefully that i wrote "pX +=" So it keeps on adding distance in every iteration of loop
|
Ho yeah ok, I missed that! Thanks.