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