SA-MP Forums Archive
How to close interiors? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to close interiors? (/showthread.php?tid=70628)



How to close interiors? - FrazZ - 26.03.2009

This might be quite obvious... but, how do I get rid of the interior markers for CJ's house and the safehouses?

Also, can someone post a command, when you get close to it you can type /enter and it goes into a 24/7?


Re: How to close interiors? - Shellegg - 26.03.2009

I think what you want is to disable the yellow markers at the "default" interiors right?
If yes just do this:

On your
pawn Код:
public OnGameModeInit()
Under it, add this
pawn Код:
DisableInteriorEnterExits();



Re: How to close interiors? - MenaceX^ - 26.03.2009

Create the /enter by yourself, Get the player pos and if he's close enough, set it.


Re: How to close interiors? - FrazZ - 26.03.2009

Quote:
Originally Posted by ★Fяαzz★
Also, can someone post a command, when you get close to it you can type /enter and it goes into a 24/7?
I asked for someone to post a code, but I already know what just not HOW to do it. Please dont get all angry at me and start arguing about the wiki... there is nothing there that actually helps me with this.

EDIT: thanks Shellegg


Re: How to close interiors? - Nero_3D - 26.03.2009

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 Код:
//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]);
        }
    }
}



Re: How to close interiors? - FrazZ - 26.03.2009

thanks
EDIT: What does the seond box mean?
if(PlayerToPoint(2.5, playerid, EnterCords[c][EC_OPos][0], EnterCords[c][EC_OPos][1], EnterCords[c][EC_OPos][2]))
In entercords what do I put lol?


Re: How to close interiors? - Google63 - 26.03.2009

That's name of array


Re: How to close interiors? - Nero_3D - 26.03.2009

You only need to edit the array (you can add so much you want, but dont forget the second last brace dont get a comma) and the command is good how it is


Re: How to close interiors? - FrazZ - 26.03.2009

So i could do this then?:
{{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0},This is the Entrance Place
{{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0},This is the interior
{{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0}
If im not correct, can you explain?


Re: How to close interiors? - Nero_3D - 26.03.2009

{{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0},

This are the entrance cordinates, where you can type /enter (no symbol added or so, you dont see it)
This are the cordinates where the player gets teleported if he types /enter
This is the interiorid where the interior is

Ah and red and green is in the X, Y, Z schema

Example

{{180.0, 90.0, 45.0}, {45.0, 90.0, 180.0}, 7},

also if he is near 180.0, 90.0, 45.0 and types enter he gets teleported to the position 45.0, 90.0, 180.0 in the interiorid 7


Re: How to close interiors? - FrazZ - 26.03.2009

Thank you! Please lock this Thanks, ♣ ⓐⓢⓢ !

EDIT: Does it have a marker? Because if it doesnt than how might I beable to add one?
EDIT 2: Cant exit :O


Re: How to close interiors? - Nero_3D - 26.03.2009

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


Re: How to close interiors? - FrazZ - 26.03.2009

sweet, thanks!


Re: How to close interiors? - Nero_3D - 27.03.2009

Here we go with /enter /exit, Info icon which display a message


Re: How to close interiors? - FrazZ - 27.03.2009

Thanks again!