How to close interiors?
#12

pawn Код:
//somewhere above
enum ECENUM { Float:EC_OPos[3], Float:EC_IPos[3], EC_Interiorid };
new EnterCords[][ECENUM] =
{
    //The first three cords are the positions of the door (where you can type enter)
    //The second three cords + the number are the position + interiorid where you will be teleported when you type /enter
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0},
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0},
    {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0} //the second last brace dont get a comma
}; //the last brace need a semicolon but that you already should know
pawn Код:
//OnGameModeInit
    for(new c; c < sizeof(EnterCords); c++)
    {
        CreatePickup(1239, 20, EnterCords[c][EC_OPos][0], EnterCords[c][EC_OPos][1], EnterCords[c][EC_OPos][2]);
        CreatePickup(1239, 20, EnterCords[c][EC_IPos][0], EnterCords[c][EC_IPos][1], EnterCords[c][EC_IPos][2]);
    }
pawn Код:
//OnPlayerCommandText
if(strcmp("/enter", cmdtext, true) == 0)
{ //you dont need to change anything here
    for(new c; c < sizeof(EnterCords); c++)
    {
        if(PlayerToPoint(2.5, playerid, EnterCords[c][EC_OPos][0], EnterCords[c][EC_OPos][1], EnterCords[c][EC_OPos][2]))
        {
            SetPlayerPos(playerid, EnterCords[c][EC_IPos][0], EnterCords[c][EC_IPos][1], EnterCords[c][EC_IPos][2]);
            return SetPlayerInterior(playerid, EnterCords[c][EC_Interiorid]);
        }
    }
}
pawn Код:
//OnPlayerCommandText
if(strcmp("/exit", cmdtext, true) == 0)
{ //you dont need to change anything here
    for(new c; c < sizeof(EnterCords); c++)
    {
        if(PlayerToPoint(2.5, playerid, EnterCords[c][EC_IPos][0], EnterCords[c][EC_IPos][1], EnterCords[c][EC_IPos][2]))
        {
            SetPlayerPos(playerid, EnterCords[c][EC_OPos][0], EnterCords[c][EC_OPos][1], EnterCords[c][EC_OPos][2]);
            return SetPlayerInterior(playerid, 0);
        }
    }
}
so now a /enter /exit command and a pickup (which isnt pickupable) as marker
Reply


Messages In This Thread
How to close interiors? - by FrazZ - 26.03.2009, 14:01
Re: How to close interiors? - by Shellegg - 26.03.2009, 14:58
Re: How to close interiors? - by MenaceX^ - 26.03.2009, 15:00
Re: How to close interiors? - by FrazZ - 26.03.2009, 15:01
Re: How to close interiors? - by Nero_3D - 26.03.2009, 16:00
Re: How to close interiors? - by FrazZ - 26.03.2009, 17:01
Re: How to close interiors? - by Google63 - 26.03.2009, 17:08
Re: How to close interiors? - by Nero_3D - 26.03.2009, 17:19
Re: How to close interiors? - by FrazZ - 26.03.2009, 18:57
Re: How to close interiors? - by Nero_3D - 26.03.2009, 19:21
Re: How to close interiors? - by FrazZ - 26.03.2009, 20:51
Re: How to close interiors? - by Nero_3D - 26.03.2009, 21:36
Re: How to close interiors? - by FrazZ - 26.03.2009, 22:02
Re: How to close interiors? - by Nero_3D - 27.03.2009, 13:17
Re: How to close interiors? - by FrazZ - 27.03.2009, 22:05

Forum Jump:


Users browsing this thread: 1 Guest(s)