How to close interiors?
#1

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?
Reply
#2

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();
Reply
#3

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

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
Reply
#5

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]);
        }
    }
}
Reply
#6

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?
Reply
#7

That's name of array
Reply
#8

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
Reply
#9

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?
Reply
#10

{{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
Reply
#11

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
Reply
#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
#13

sweet, thanks!
Reply
#14

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

Thanks again!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)