13.06.2015, 08:00
PHP код:
CMD:enter(playerid,params[])
{
// First line: We are checking if here IS NOT near the entrance and if we confirm that we return him message.
if(!IsPlayerInRangeOfPoint(playerid,4.0,2522.8105,-1679.3905,15.4970)) return SendClientMessage(playerid,-1,"ERROR: You are not near the entrance");
else // else if he is near the entrance...
{
SetPlayerPos(playerid,2527.654052,-1679.388305,1015.498596); // Setting position..
SetPlayerInterior(playerid,1); // ... And interior. DONE!
}
return 1;
}
CMD:exit(playerid,params[])
{
// Here we have done the same thing just changed the coordinates.
if(!IsPlayerInRangeOfPoint(playerid,4.0,2527.654052,-1679.388305,1015.498596)) return SendClientMessage(playerid,-1,"ERROR: You are not near the exit");
else
{
SetPlayerPos(playerid,2522.8105,-1679.3905,15.4970);
SetPlayerInterior(playerid,0);
}
return 1;
}