New Housing Idea.
#21

Why not just use an actual door, and have them hit a key on their keyboard (KEY_SECONDARY_ATTACK?) to open and close the door, and legitimately move the object. It seems like a REALLY good idea though!
Reply
#22

Quote:
Originally Posted by 2KY
Посмотреть сообщение
Why not just use an actual door, and have them hit a key on their keyboard (KEY_SECONDARY_ATTACK?) to open and close the door, and legitimately move the object. It seems like a REALLY good idea though!
16 would be best, it's the same key for entering vehicles so why not entering other stuff?

You could find the animation from the standard door-walking-in (from the yellow/green/orange arrows at Ammunations and fast food places etc)

When the player hits the key near the door, replace the door with a moving one and play the animation! (I think that's how it works in single player too, either that or the door has a 'rigid' variable that is unset when the player enters)


Would look nice though!
Reply
#23

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
16 would be best, it's the same key for entering vehicles so why not entering other stuff?

You could find the animation from the standard door-walking-in (from the yellow/green/orange arrows at Ammunations and fast food places etc)

When the player hits the key near the door, replace the door with a moving one and play the animation! (I think that's how it works in single player too, either that or the door has a 'rigid' variable that is unset when the player enters)


Would look nice though!
That seems like it'd be a perfect idea! I once started working on a GTA IV-styled city, I never got far though unfortunately, because mapping is not the thing for me.
Reply
#24

I also have thought a lot about this and how to make it work best in a gamemode.

The "entry/exit problem" discussed here is very important i agree making the swing doors for owners and static doors (blocking with same texture) for others seems smart. I would go on here and use a key system for the doors which would make it more realistic and you wouldn't have to do checks of who owns the house/biz. So when unlocked you place the swingdoor and when locked you place the static blocking door instead. This would work nicely and can be done practically.

The only problem i have with this is that a lot of cheaters using hacks can go through blocking walls / objects these days and it could mess the idea up pretty good. A cheater teleporting himself 1 meter to the other side of a door / wall is very hard to detect because most anti teleports work by looking at if a person moved a great distance in a short time.

We could script an effective anti-cheat for this but it would require for us to abandon the freeroam swingdoor idea(unlocked state) because the server needs to keep track of who is "legally" inside that building. To keep track of this we need a command or a keypress (dont matter which we choose here) to enter/exit the building and the server would know if the player entered the building correctly. We could use some eye candy here and do it like in singleplayer by replacing static blocking door with swinging door (for that player only) and use walking animation + setvelocity to walk the player through the door. Point being that the server would know that the player is supposed to be in there.

EDIT:
However this could look strange on other players screens because other players would see the entering player clash with the static door (on their screen) and we cant place the swinging door for all others as they could then run through the swing door. I guess it would need some testing but the anti cheat defently introduce some problems.
Reply
#25

Tomorrow I'm going to have a go at scripting this!
Reply
#26

After reading Hansen's pose, I came up with this:

When the player walks in, you can keep it semi-freeroam style, (still with freeform movement, no teleport) by:

- Checking if the player is in the area of the door and if they are walking towards it.
- If they are, Apply the walking+opening door animation and make the player walk through the centre of the object
- Hopefully, this should block the doorway so only that player can walk through.
- As soon as they are through (Measure the anim timing), immediately create an invisible wall while the door closes (This will stop any unwanted people from following)


If not, you could go with super realistic challenge and just make it swing for everyone until the owner locks it (At which point, a solid door with the same texture will be put there). If someone wants to risk breaking and entering then the player in the inside can still call cops / use a weapon etc.

I've not really played one of these anal RP servers, no idea how realistic and challenging people like it
Reply
#27

Quote:
Originally Posted by hansen111
Посмотреть сообщение
The "entry/exit problem" discussed here is very important i agree making the swing doors for owners and static doors (blocking with same texture) for others seems smart.
To be quite honest, I have no idea how I would go about making the swinging door only for the owner. I do know how playerobjects work, it's just to me it seems more practical this way.
  • Have three objects for each house.
  • One to block the front side of the door (invisible)
  • One to block the back (invisible)
  • The swingy door itself.
In the lock command, it would just toggle the invisible objects.

I've gotten up to a point where a door can be created in front of a player with both objects (invisble walls that act as locks) with GetXYInFrontOfPlayer, but I haven't figured out the math to align the door directly in the center between the locks. I honestly am clueless when it comes to that kind of math in a scripting language.

EDIT:
Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
- Checking if the player is in the area of the door and if they are walking towards it.
That's a really good idea. I can just SetPlayerFacingAngle in relation to the rotZ of the swinging door.

EDIT 2: Anyone feel like going around re-mapping all the houses with the ones cessil added? :P
Reply
#28

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
EDIT 2: Anyone feel like going around re-mapping all the houses with the ones cessil added? :P
I started in LV!

A good method is to get all the IDs, write a small program that reads the map data files, finds the data lines with IDs.

Then you can just program it to produce RemoveBuilding and CreateObject lines for the buildings.

Of course you'll have to "match-up" Cecil's buildings with the ones that exist, shouldn't be too hard though
Reply
#29

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
When the player walks in, you can keep it semi-freeroam style, (still with freeform movement, no teleport) by:
- Checking if the player is in the area of the door and if they are walking towards it.
- If they are, Apply the walking+opening door animation and make the player walk through the centre of the object
This can be done also without any major problems but at the expense of timers checking player locations at all times but it would remove the need for a enter/exit command or keypress. If a anti-cheat (teleport) is going to be implemented a timer checking player positions would be needed anyway. I still dont know if the blocking of the swing door (during enter sequence) would work right though, have to test.

If you dont care about the anticheat the best clean way to do is to have the freeroam swing door for everyone when door is unlocked and the static blocking door when locked, this works without any problems.
Reply
#30

You could also use the streamer plugin to create a polygon area for each house, then you have a method of knowing who's inside and outside regardless of whether they have used the door.

If someone gets in to the area without using methods such as breaking in through windows (scripted robbery system) or going through the door, they must be cheating.
Reply
#31

Do you know which is the model for stripped houses?

NVM. Already found
Reply
#32

why not make this when player come near to entering it ask for house password(house password only owner knows) so this only owner can enter house, not all the players r in without permission
Reply
#33

Just use a door object, that doesn't have the swing mechanism, and then use the SAMP rotate function to open the door only for the owner? Would look realistic AND work great!
Reply
#34

Quote:
Originally Posted by sim_sima
Посмотреть сообщение
Just use a door object, that doesn't have the swing mechanism, and then use the SAMP rotate function to open the door only for the owner? Would look realistic AND work great!
That's a great Idea! only one object, one key to open the door, if you are the owner/have the key, and another press to close it.
Reply
#35

What object do you use for glass in the windows? (On the first screen shot)
Reply
#36

wg_glasssmash
Reply
#37

19466 - glenphouse03_lax

It's unbreakable glass.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)