How to set another arrow on north?
#1

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?
Reply
#2

I tried to add on Y but not work well...
I want add another arrow on north of last arrow direction

Anybody know this?
Reply
#3

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(playeridparams[])
{
    new 
Float:pX,Float:pY,Float:pZFloat:a;
    
GetPlayerFacingAngle(playerida);
    
GetPlayerPos(playerid,pX,pY,pZ);
    for(new 
110i++) {
        
pX += floatmul(2floatsin(-adegrees));
        
pY += floatmul(2floatcos(-adegrees));
        
CreateObject(1318pXpYpZ09090-a);
    }
    return 
1;

Reply
#4

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(playeridparams[])
{
    new 
Float:pX,Float:pY,Float:pZFloat:a;
    
GetPlayerFacingAngle(playerida);
    
GetPlayerPos(playerid,pX,pY,pZ);
    for(new 
110i++) {
        
pX += floatmul(2floatsin(-adegrees));
        
pY += floatmul(2floatcos(-adegrees));
        
CreateObject(1318pXpYpZ09090-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
Reply
#5

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
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)