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;
}
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;
}
CMD:exit(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, InterInfo[PlayerInfo[playerid][Inter]][IntPos][0], InterInfo[PlayerInfo[playerid][Inter]][IntPos][1], InterInfo[PlayerInfo[playerid][Inter]][IntPos][2]))
{
SendClientMessage(playerid, BLUE, "You have left the interior successfully. /enter to enter it.");
SetPlayerPos(playerid, InterInfo[PlayerInfo[playerid][Inter]][EnterPos][0], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][1], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][2]);
SetPlayerInterior(playerid, 0);
}
return 1;
}
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.");
PlayerInfo[playerid][Inter] = x;
SetPlayerInterior(playerid, InterInfo[x][Interiorid]);
SetPlayerPos(playerid, InterInfo[x][IntPos][0], InterInfo[x][IntPos][1], InterInfo[x][IntPos][2]);
}
}
return 1;
}
CMD:exit(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, InterInfo[PlayerInfo[playerid][Inter]][IntPos][0], InterInfo[PlayerInfo[playerid][Inter]][IntPos][1], InterInfo[PlayerInfo[playerid][Inter]][IntPos][2]))
{
SendClientMessage(playerid, BLUE, "You have left the interior successfully. /enter to enter it.");
PlayerInfo[playerid][Inter] = -1;
SetPlayerPos(playerid, InterInfo[PlayerInfo[playerid][Inter]][EnterPos][0], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][1], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][2]);
SetPlayerInterior(playerid, 0);
}
return 1;
}
I'm sorry for triple posting, you can reduce my posts, I've faced another problem now;
When I use /enter and try to do /exit it says ''SERVER: Unknown command", any solution? |
CMD:exit(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, InterInfo[PlayerInfo[playerid][Inter]][IntPos][0], InterInfo[PlayerInfo[playerid][Inter]][IntPos][1], InterInfo[PlayerInfo[playerid][Inter]][IntPos][2]))
{
SendClientMessage(playerid, BLUE, "You have left the interior successfully. /enter to enter it.");
PlayerInfo[playerid][Inter] = -1;
SetPlayerPos(playerid, InterInfo[PlayerInfo[playerid][Inter]][EnterPos][0], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][1], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][2]);
SetPlayerInterior(playerid, 0);
}
else SendClientMessage(playerid, RED, "You are not near to an interior exit.");
return 1;
}
CMD:exit(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, InterInfo[PlayerInfo[playerid][Inter]][IntPos][0], InterInfo[PlayerInfo[playerid][Inter]][IntPos][1], InterInfo[PlayerInfo[playerid][Inter]][IntPos][2]))
{
SendClientMessage(playerid, BLUE, "You have left the interior successfully. /enter to enter it.");
SetPlayerPos(playerid, InterInfo[PlayerInfo[playerid][Inter]][EnterPos][0], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][1], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][2]);
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][Inter] = -1;
}
else SendClientMessage(playerid, RED, "You are not near to an interior exit.");
return 1;
}
CMD:exit(playerid,params[])
{
SendClientMessage(playerid, BLUE, "You have left the interior successfully. /enter to enter it.");
SetPlayerPos(playerid, InterInfo[PlayerInfo[playerid][Inter]][EnterPos][0], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][1], InterInfo[PlayerInfo[playerid][Inter]][EnterPos][2]);
SetPlayerInterior(playerid, 0);
PlayerInfo[playerid][Inter] = -1;
return 1;
}