SA-MP Forums Archive
Help with /enter - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with /enter (/showthread.php?tid=651931)



Help with /enter - PizzaMag - 30.03.2018

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.


Re: Help with /enter - UFF - 31.03.2018

Код:
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


Re: Help with /enter - MadeMan - 31.03.2018

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;
}



Re: Help with /enter - PizzaMag - 31.03.2018

Thank you, it works perfectly!