30.03.2018, 21:54
So I have made an arrow system and POS's are saved successfully.
Here is the code:
When I try to do /enter, it keeps returning the error "No entrance nearby!".
I tried going another way, such as:
And it still returns the same error.
Here is the code:
PHP код:
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;
}
I tried going another way, such as:
PHP код:
CMD:enter(playerid,params[])
{
for(new i = 0; i < MAX_ARROWS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5, ArrowInfo[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;
}