SA-MP Forums Archive
enterible buildings - 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)
+--- Thread: enterible buildings (/showthread.php?tid=564160)



enterible buildings - semaj - 19.02.2015

Can someone help me with making a enterible building

This would be the door entrance and using the LV police HQ as the interior
Код:
1545.7811,-1269.5010,17.4063
door exit spawn point outside
Код:
1547.1053,-1271.2018,17.4063,137.6826
not sure if its CreateDynamicPickup or CreateDynamicObject witch is used for doors


Re: enterible buildings - CalvinC - 19.02.2015

Create a command called /enter and /exit.
With /enter:
Check if the player is in range of the outside point of the building
Quote:

1547.1053,-1271.2018,17.4063,137.6826

Using IsPlayerInRangeOfPoint.
Then if he is, use SetPlayerPos to set the player's position to the inside coordinates.
Quote:

1545.7811,-1269.5010,17.4063

Do the same with /exit, check if they are at the inside coordinates, if so, SetPlayerPos to the outside coordinates.


Re: enterible buildings - semaj - 19.02.2015

am trying to do it without any commands using CreateDynamicObject


Re: enterible buildings - CalvinC - 19.02.2015

Can you be a bit more specific how you want to make the player enter/exit a building then?
If you want it to be when he picks up a pickup, use OnPlayerPickUpPickup and SetPlayerPos in there instead.


Re: enterible buildings - semaj - 19.02.2015

i have posted it on pastebin to have a look

http://pastebin.com/E5gC8GTJ


Re: enterible buildings - semaj - 19.02.2015

there is already ones there but as i dont understand how its done am not sure


Re: enterible buildings - CalvinC - 19.02.2015

First declare a name we're gonna use for the pickup, do something like this in the top of your gamemode:
pawn Код:
new PickupOutside;
Then create the pickup in OnGameModeInit, and give it the name we created:
pawn Код:
PickupOutside = CreatePickup( ... );
Then to detect if you picked up that pickup, use this in OnPlayerPickUpPickup:
pawn Код:
switch(pickupid) // Creates a switch, checking "pickupid", which will return the name of the pickup picked up
{
    case PickupOutside: SetPlayerPos(playerid, ... ); // If the pickup name was "PickupOutside", SetPlayerPos to the interior
    // Other cases etc...
}
Then you do the same with other pickups, just give them different names, and add more cases in the switch.

EDIT: Or you can use the "if"'s instead of a switch like in the gamemode, but i recommend using a switch.


Re: enterible buildings - semaj - 19.02.2015

with that interior when i go in the marker it takes me to the LV police HQ and than i spawn out there how would i fix that issue?


Re: enterible buildings - CalvinC - 19.02.2015

Use some other coordinates to another interior.


Re: enterible buildings - semaj - 19.02.2015

not sure what you mean