23.02.2014, 18:59
So, I've created interior system with stock but I have a problem with /enter and /exit.
When I /enter in one interior and I do /exit, it'll teleport me infront of another interior..
This is enter:
And this is exit:
Any solution?
When I /enter in one interior and I do /exit, it'll teleport me infront of another interior..
This is enter:
pawn Код:
CMD:enter(playerid,params[])
{
for(new x=0; x < MAX_INTS; x++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, InterInfo[x][EnterPos][0], InterInfo[x][EnterPos][1], InterInfo[x][EnterPos][2]))
{
SendClientMessage(playerid, BLUE, "You have entered the interior successfully. /exit to leave it.");
SetPlayerInterior(playerid, InterInfo[x][Interiorid]);
SetPlayerPos(playerid, InterInfo[x][IntPos][0], InterInfo[x][IntPos][1], InterInfo[x][IntPos][2]);
}
}
return 1;
}
pawn Код:
CMD:exit(playerid,params[])
{
for(new x=0; x < MAX_INTS; x++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, InterInfo[x][IntPos][0], InterInfo[x][IntPos][1], InterInfo[x][IntPos][2]))
{
SendClientMessage(playerid, BLUE, "You have left the interior successfully. /enter to enter it.");
SetPlayerPos(playerid, InterInfo[x][EnterPos][0], InterInfo[x][EnterPos][1], InterInfo[x][EnterPos][2]);
SetPlayerInterior(playerid, 0);
}
}
return 1;
}