Quote:
Originally Posted by Ozborne
I am very new to pawno and am working on finishing one of my map filterscripts. I am just wondering if it is possible to delete objects in a different world without it being deleted in the normal one.
I am mapping out a biker hq and I wanted a basement in that certain location so I had to delete a section of ground. Well once as I got to pawno, I am stuck. The removeplayerobject to remove the ground for my interior is also messing up the ground for my exterior.
I am pretty much just wondering if it is possible and how?
If someone can help me out, it would be greatly appreciated.
|
Don't do it that way, Instead, make your interior high in the sky (Where you can still find it), and create a "door" to the interior area. It is a bit confusing in code, but I can walk you through it...
Код:
//under #endif
new enter1;
new exit1;
//Under OnGameModeInit(...)
enter1 = CreatePickup(1559, 1, 2151.5, -1789.19995, 15, -1);
exit1 = CreatePickup(1559, 1, 2140.1001, -1798.19995, 968.20001, -1);
//under OnPlayerPickUpPickup(...)
if(pickupid == enter1)
{
SetPlayerPos(playerid, 2140, -1796.09998, 969.50001);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
GivePlayerMoney(playerid, -200);
SendClientMessage(playerid, 0x00FFFFFF, "=======Please Enjoy your stay=======");
}
else if(pickupid == exit1)
{
SetPlayerPos(playerid, 2156.6001, -1800.69995, 14.3);
SetPlayerFacingAngle(playerid, 270);
SetCameraBehindPlayer(playerid);
}
THIS IS JUST DEMO CODE
Let's start with saying that you need to define 2 'new' variables, door in, and door out.
We are going to create a pickup that will send you to the interior, and another to send you to the exterior (or back to the map). Place the 'enter1' pickup coordinates in front of the front door of your exterior building, and the 'exit1' pickup coords at the exit of your interior.
https://sampwiki.blast.hk/wiki/CreatePickup for more info on pickups.
Now we need to tell the pickups what to do. In the first pickup, we set the position of where we wanted the player to go after 'entering' the building. We then had to test where we would be facing and fixed it by forcing facing angle, and set the camera behind player. The same goes for the exit, only that you set the coords to where you want the player to be 'outside' after they exit. Bonus: Give player money will give player money (obviously) but if it's a negative number, it will take it away. For example, this script charges the player $200 to enter. Send Client message also leaves a message to the player when they enter.
https://sampforum.blast.hk/showthread.php?tid=446880 for an example of multiple doors.
Was this any help?