04.09.2011, 05:38
Nice tutorial, but an even better method for the enter command is this:
No need for two or more "enters", just re-check where the player is.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/enter", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,RADIUS X, Y, Z))
{
SetPlayerPos(playerid, X, Y, Z);
SetPlayerInterior(playerid, INTERIORID);
SetPlayerVirtualWorld(playerid, VIRTUALWORLD); // Optional
SetCameraBehindPlayer(playerid);
return 1;
}
else if (IsPlayerInRangeOfPoint(playerid,RADIUS, X, Y, Z))
{
SetPlayerPos(playerid, X, Y, Z);
SetPlayerInterior(playerid, INTERIORID);
SetPlayerVirtualWorld(playerid, VIRTUALWORLD); // Optional
SetCameraBehindPlayer(playerid);
return 1;
}
return 1;
}
return 0;
}