enterible buildings
#1

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

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.
Reply
#3

am trying to do it without any commands using CreateDynamicObject
Reply
#4

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

i have posted it on pastebin to have a look

http://pastebin.com/E5gC8GTJ
Reply
#6

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

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.
Reply
#8

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

Use some other coordinates to another interior.
Reply
#10

not sure what you mean
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)