Limit object editing to a certain area? [Brainstorming]
#1

Hey guys!

As you all know editing objects became the thing in SA:MP and after a certain update we were able to edit objects in-game with the object editor.

Now there are servers where you can build your own house, but how do you limit the area the player can build in?

I already went ahead and added a 15m plot hole which detects if the object the player is editing is out of it but I don't know what to do when the object leaves the 15m area.

If I try to move it back to its original location without stopping the editing it will keep popping back to the location the player is moving it, allowing him to keep on surfing / going through walls (that's the point, to stop players from flying through everything on an object [surfing]).

If I stop the editing process at the milisecond the player is out of the boundaries the mouse will disappear so the player won't be able to properly edit objects without reconnecting, the mouse will not re-appear.

I'd like to think that some servers already resolved this issue because I've seen some servers with plot systems.

So lets work out a solution to this?

Thanks to everyone who will reply and try to fix this issue!

~ Gergő
Reply
#2

Create a dynamic area using streamer plugin - use virtualworlds if you want - about the out of boundaries - under onplayereditdynamicobject under update check the new position of the object if its out of boundaries cancel editing and send the message.

I hope I helped any feedback is appreciated!
Reply
#3

I don't think there is any way to prevent them holding down the buttons and like you said "going through" the objects or anywhere else. However, you can detect if they are surfing an object.
As for limiting the build area - if it's a polygon, you're gonna have a hard time figuring the area with basic PAWN functions but if it's a simple square or a rectangle you can simply check if object coordinates are inside bounds. For advanced shapes, you can use the Streamer plugin which has the area functions you want.
Reply
#4

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Create a dynamic area using streamer plugin - use virtualworlds if you want - about the out of boundaries - under onplayereditdynamicobject under update check the new position of the object if its out of boundaries cancel editing and send the message.

I hope I helped any feedback is appreciated!
Yeah this is what I originally did but here's the problem:

If I cancel editing while the player is holding the mouse button the mouse disappears, so when the object editing is canceled his mouse will be gone ,,forever" (= until he reconnects), even if he tries to edit again his mouse won't re appear.


Edit.:

@Virtual1ty:

Yeah but I can't really do anything by detecting if the player is surfing, I tried a few things but the abuser will slowly get closer and closer and will be able to eventually no clip through a wall. There are a few seconds when the player can still surf and abuse those precious moments.

Edit 2.:

The area where the players can move their objects is already set so there's no problem with that, the only problem I have is not being able to properly stop the object when it exits the area. I can stop the editing but it brings up more problems = the mouse disappearing.
Reply
#5

Then put them in spectate mode and use SetPlayerCameraPos/LookAt to view an object or use AttachCameraToObject.

Edit on your note 2:
Yeah, I've tested that it's not an option to stop an object once it leaves the edit area. You can re-show the mouse by calling EditObject(), can't you?
Reply
#6

No, the mouse will be gone and it will not reappear whatever you do and it's impossible to do anything in that case.

Tried object selection, textdraw selection, alt tab, dialog selection, pressing TAB, the mouse won't reappear and that is my main problem. I'm able to stop the object editing but the mouse is simply gone

Edit.: I think you missunderstood me so I'm editing this, the selection comes up, you can select it but you don't see the mouse icon.
Reply
#7

I don't think I misunderstood you. Under what circumstances doesn't the mouse ("icon") show? If I use CancelEdit() to stop editing and EditObject() to start editing and not SelectObject() to select an object, the mouse will show up again. I experience no problems with that. If you could create a minimal script so we could replicate the issue, that would be nice.
Reply
#8

The script I made automatically stops the object when its dragged out of the zone, while its being dragged that's why the mouse disappears, I'll show you a video I just made. in the video its kinda reversed, it stops the object from being dragged anywhere just to show you the problem im having. Hope you can see the text I type in game, sorry for typos I don't even have my headset on I just quickly sat here for a few minutes!

Basically it cancels selection automatically when you try to drag the object and the mouse will not reappear, everything is working fine it's just the mouse that disappears. I think I should report this to SA:MP instead of trying to find a way around it here.

Video: https://www.youtube.com/watch?v=Cj6b...ature=*********
Reply
#9

I would test it out on a minimal script just to make sure it's not something to do with your mode, or text draws.
But looking at the video, it sounds like a SA:MP client bug most likely.
Reply
#10

Yeah I really think it's a SAMP bug too, I posted it here so someone could try to find a way around it but now I've posted it to SA:MP bugs too. Thanks for your help anyway you've been actually following up answering my posts so I'm giving you a rep!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)