[Tutorial] How to make Entrances and Exits
#10

Nice tutorial, but an even better method for the enter command is this:

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;
}
No need for two or more "enters", just re-check where the player is.
Reply


Messages In This Thread
How to make Entrances and Exits - by PhoenixB - 16.08.2011, 15:47
Re: How to make Entrances and Exits - by seanny - 16.08.2011, 16:11
Re: How to make Entrances and Exits - by PhoenixB - 16.08.2011, 16:13
Re : How to make Entrances and Exits - by Naruto_Emilio - 16.08.2011, 16:59
Re: How to make Entrances and Exits - by PhoenixB - 16.08.2011, 17:04
Re: How to make Entrances and Exits - by dr.pepper - 16.08.2011, 17:07
Re: How to make Entrances and Exits - by PhoenixB - 16.08.2011, 17:11
Re: How to make Entrances and Exits - by Coffeemonster - 17.08.2011, 10:47
Re: How to make Entrances and Exits - by PhoenixB - 17.08.2011, 17:15
Re: How to make Entrances and Exits - by Jack_Leslie - 04.09.2011, 05:38

Forum Jump:


Users browsing this thread: 1 Guest(s)