Help with /enter
#1

So I have made an arrow system and POS's are saved successfully.
Here is the code:
PHP код:
CMD:enter(playerid,params[])
{
    for(new 
0MAX_ARROWSi++)
    {
        if(
ArrowInfo[i][ArrowUsed] == true)
        {
            if(
IsPlayerInRangeOfPoint(playerid5ArrowInfo[i][arrowx], ArrowInfo[i][arrowy], ArrowInfo[i][arrowz]))
             {
                  if(
ArrowInfo[i][Linked] == false) return SendClientMessage(playerid,COLOR_RED,"This arrow is not linked!");
                    
SetPlayerPos(playerid,ArrowInfo[i][Linkedwithx],ArrowInfo[i][Linkedwithy],ArrowInfo[i][Linkedwithz]);
            }
            else return 
SendClientMessage(playerid,COLOR_RED,"No entrance nearby!");
        }
    }
    return 
1;

When I try to do /enter, it keeps returning the error "No entrance nearby!".

I tried going another way, such as:
PHP код:
CMD:enter(playerid,params[])
{
    for(new 
0MAX_ARROWSi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid5ArrowInfo[i][arrowx], ArrowInfo[i][arrowy], ArrowInfo[i][arrowz]))
        {
            if(
ArrowInfo[i][ArrowUsed] == true)
            {
                if(
ArrowInfo[i][Linked] == false) return SendClientMessage(playerid,COLOR_RED,"This arrow is not linked!");
                
SetPlayerPos(playerid,ArrowInfo[i][Linkedwithx],ArrowInfo[i][Linkedwithy],ArrowInfo[i][Linkedwithz]);
            }
        }
        else return 
SendClientMessage(playerid,COLOR_RED,"No entrance nearby!");
    }
    return 
1;

And it still returns the same error.
Reply
#2

Код:
CMD:enter(playerid,params[]) 
{ 
    for(new i = 0; i < MAX_ARROWS; i++) 
    { 
        if(ArrowInfo[i][ArrowUsed] == true) 
        { 
            if(IsPlayerInRangeOfPoint(playerid, 5, ArrowInfo[i][arrowx], ArrowInfo[i][arrowy], ArrowInfo[i][arrowz])) 
             { 
                  if(ArrowInfo[i][Linked] == false) return SendClientMessage(playerid,COLOR_RED,"This arrow is not linked!"); 
                    SetPlayerPos(playerid,ArrowInfo[i][Linkedwithx],ArrowInfo[i][Linkedwithy],ArrowInfo[i][Linkedwithz]); 
            }  
        }
        else return SendClientMessage(playerid,COLOR_RED,"No entrance nearby!"); 
    } 
    return 1; 
}
Try this
Reply
#3

pawn Код:
CMD:enter(playerid,params[])
{
    for(new i = 0; i < MAX_ARROWS; i++)
    {
        if(ArrowInfo[i][ArrowUsed] == true)
        {
            if(IsPlayerInRangeOfPoint(playerid, 5, ArrowInfo[i][arrowx], ArrowInfo[i][arrowy], ArrowInfo[i][arrowz]))
            {
                if(ArrowInfo[i][Linked] == false) return SendClientMessage(playerid,COLOR_RED,"This arrow is not linked!");
                SetPlayerPos(playerid,ArrowInfo[i][Linkedwithx],ArrowInfo[i][Linkedwithy],ArrowInfo[i][Linkedwithz]);
                return 1;
            }
        }
    }
    SendClientMessage(playerid,COLOR_RED,"No entrance nearby!");
    return 1;
}
Reply
#4

Thank you, it works perfectly!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)