22.07.2012, 21:49
Basically what I've tried to do is map an interior inside a building. However, if I enter inside the interior, the collision forces of that building would force me out, so I had to remove it everytime I /enter the building and add it back everytime I /exit the building. The problem is : When 2 or more players are inside (the building is removed ), and one of them types /exit, the building appears back for EVERYONE and so the guys that are inside the building are forced out through the ground, due to the collisions.
How can I make it so that the building appears back only for the person that types the /exit command?
Here is the code:
And here are two pictures to understand what I've done:
How can I make it so that the building appears back only for the person that types the /exit command?
Here is the code:
Код:
COMMAND:enter(playerid, params[]) { if (IsPlayerInRangeOfPoint(playerid, 1.0, 172.66, -152.10, 1.72)) // checks if in range of the /enter point { RemoveBuildingForPlayer(playerid, 13200, 158.3594, -176.3047, 5.5703, 0.25); RemoveBuildingForPlayer(playerid, 12923, 158.3594, -176.3047, 5.5703, 0.25); SetPlayerPos(playerid, 170.75, -153.94, 1.81); // Sets their new position } return 1; } COMMAND:exit(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 1.0, 170.85, -153.85, 1.48)) // Checks if near the exit door { RemoveObjectVar2 = CreateObject(12923, 158.3594, -176.3047, 5.5703, 0, 0, 0, 300); SetPlayerPos(playerid, 172.24, -152.26, 1.81); } return 1; }