Jump to content

Unlock Shop Doors


Vaskulis

Recommended Posts

Hello there,

 

I have a problem with the doors of shops being closed when I spawn my callout stuff in there. When there's been a robbery, or what the game thinks is a robbery, the doors get locked for a while once you leave the area and that means no callout stuff can come through those doors. It follows that I can't spawn the same callout twice at the same location.
What I would love to know is how to make sure the doors are unlocked when I need them to be. Much like they are in @Albo1125's robbery callout.

 

Any ideas are appreciated!

Link to comment
Share on other sites

47 minutes ago, Vaskulis said:

Hello there,

 

I have a problem with the doors of shops being closed when I spawn my callout stuff in there. When there's been a robbery, or what the game thinks is a robbery, the doors get locked for a while once you leave the area and that means no callout stuff can come through those doors. It follows that I can't spawn the same callout twice at the same location.
What I would love to know is how to make sure the doors are unlocked when I need them to be. Much like they are in @Albo1125's robbery callout.

 

Any ideas are appreciated!

I assume that you said, your own callouts -- so you create your own callouts. You have the ability to make those doors stay open! Code it in. Find scripts here or on GTA5-mods.com and yeah!

 

Link to comment
Share on other sites

1 hour ago, DSonke1 said:

I assume that you said, your own callouts -- so you create your own callouts. You have the ability to make those doors stay open! Code it in. Find scripts here or on GTA5-mods.com and yeah!

 

No offense, but you are not very helpful. If I knew how to "code it in", I wouldn't need to ask here...

 

Back to topic: I found and played around with the native SET_STATE_OF_CLOSEST_DOOR_OF_TYPE but it seems to be very unreliable, only doing what it's supposed to in about 20% of cases, or am I just using it wrong and don't see the pattern? Anyone have experience with it?

Link to comment
Share on other sites

Haha, I know! I wasn't really trying to be helpful until you came up with an answer!

 

On the other side, I wouldn't use SET_STATE_OF_CLOSEST_DOOR_OF_TYPE

I would use it as a function

 

I.e. Function.IsPedArrested(ped);

 

I couldn't pull up exactly what you wanted since my Visual Studios is running with other things right now. 

 

http://ragepluginhook.net/Documentation.aspx

 

Here is great documentation and you should be able to do what ever you want as long as you have the

 

using Rage;

 

as a reference and the actual reference added. 

 

PM for more help. If needed.

Link to comment
Share on other sites

4 hours ago, DSonke1 said:

Haha, I know! I wasn't really trying to be helpful until you came up with an answer!

 

On the other side, I wouldn't use SET_STATE_OF_CLOSEST_DOOR_OF_TYPE

I would use it as a function

 

I.e. Function.IsPedArrested(ped);

 

I couldn't pull up exactly what you wanted since my Visual Studios is running with other things right now. 

 

http://ragepluginhook.net/Documentation.aspx

 

Here is great documentation and you should be able to do what ever you want as long as you have the

 

using Rage;

 

as a reference and the actual reference added. 

 

PM for more help. If needed.

 

I appreciate what you are trying to do, but I believe you misunderstand me. I'm a little more advanced than you think (and of course I know how to read and search the RPH doc and NativeDB). I just need help with one very particular problem, which I know has been solved before, so I'm asking on this forum.

Link to comment
Share on other sites

Okay, so just in case anyone is interested:

 

SET_STATE_OF_CLOSEST_DOOR_OF_TYPE has a very low margin of error for the positions. You need to use coordinates that are basically at the exact position of the door's loose end when it's closed. So, of course when I called it with the LPC's position, it only worked when I was standing right in the doorway.

Also: You can use the door model's hash for the doorType parameter, which is nice.

Edited by Vaskulis
Link to comment
Share on other sites

12 hours ago, Vaskulis said:

Okay, so just in case anyone is interested:

 

SET_STATE_OF_CLOSEST_DOOR_OF_TYPE has a very low margin of error for the positions. You need to use coordinates that are basically at the exact position of the door's loose end when it's closed. So, of course when I called it with the LPC's position, it only worked when I was standing right in the doorway.

Also: You can use the door model's hash for the doorType parameter, which is nice.

 

I have a vague memory of there also being something like GET_CLOSEST_DOOR_OF_TYPE or something similar that you could use to get the coord of the nearest door, then set its state. Worth doing some searching over on gtaforums.com as I know I've seen stuff there about it a while ago.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

Link to comment
Share on other sites

5 hours ago, Darkmyre said:

 

I have a vague memory of there also being something like GET_CLOSEST_DOOR_OF_TYPE or something similar that you could use to get the coord of the nearest door, then set its state. Worth doing some searching over on gtaforums.com as I know I've seen stuff there about it a while ago.

 

There is, but it also needs coordinates so I reckon it's a bit pointless. Maybe it allows for the coordinates to be a bit farther away, but my method is working now. Just requires me to collect another set of coordinates per callout location.
And the NativeDB comments on SET_CLOSEST_DOOR_OF_TYPE make you think that the doorType was some special kind of hash hidden in some file somewhere, but it also works with the model hashes.

Link to comment
Share on other sites

Maybe you could use World.GetAllObjects, and iterate to find the nearest that's a door, then pass that to the appropriate native.

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Link to comment
Share on other sites

9 hours ago, PNWParksFan said:

Maybe you could use World.GetAllObjects, and iterate to find the nearest that's a door, then pass that to the appropriate native.

 

Huh, I  guess that could work. I could even pass a list of all the doors that any shop could have and make it open the closest two it finds, so I wouldn't even need to know which exact model of door(s) each shop has.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...