Is there a script that can create and set up specific zones where players cannot run or jump? If you are a script developer and interested, we would love to talk to you.
I think you can take a “safe zone” script and adapt it to your needs
Or create one via the “Zones” of OxLib or Polyzone
Thank you!!
i see, but maybe i cant do that only me so i will be want help.
I think this could help you, I wrote it from my mobile, I don’t promise it will work . But you can use it as a reference.
To understand how ox_lib works, visit its wiki.
function onEnter(self)
lib.disableControls:Add(22)
end
function onExit(self)
lib.disableControls:Remove(22)
end
function inside(self)
lib.disableControls()
end
local sphere = lib.zones.sphere({
coords = vec3(442.5363, -1017.666, 28.65637),
radius = 5,
debug = true,
inside = inside,
onEnter = onEnter,
onExit = onExit
})
Also, to answer this question, you can absolutely do this, but it requires a little bit (and I really do mean a little bit quite literally) of planning. It sounds like you’re trying to create a safezone of sorts which is great, but there are some questions you’ll want to ask yourself which will determine how complex / simple this will be
The Questions:
Will friends play this? Just you? The world?
What kind of zone do I want to enforce?
Will I also disable violent player actions?
Will ALL players (including admins) have this enforced?
What happens if a player walks into your zone with weapons?
What happens if you’re in a vehicle and enter the zone?
Starting a planning phase for each resource or goal you want to create gets you in the habit of planning, and trying to anticipate challenges before approaching them. Also, executing will give you the experience to plan better.
For me, I wanted to do something similar, except using an interior. Specifically fort zancudo. So here’s the gist of what I did:
Update players information (using natives to get the player, their location, the interior at the players location, the roomkey of the interior the player was in.
Then, if the player is inside, or near the interior of choice, I basically remove player weapons, disabled player firing, and disabled the following controls:
- 12-29 (excluding 18, 19, 20, and 26)
- 37, 44, 47, 140, 141, 142
- 172-186
(Resources on what those controls translate to can be found here)
So now, when a player enters a particular interior, they can’t really do anything violent. Now, if I was just playing with friends, this would in theory be okay, but players can still ram into and kill other players. So I may need to despawn vehicles that try to drive / fly into that area…
But I say that to say, coming up with a plan of action is the best way to start on and end a task or project.
If you have questions on the natives i’ve used, feel free to reach out!
Good luck!
Thank you so much!!!
I’ll try it !!
Can you help me if I am in trouble?
This is my discord: emir.lua
Thank you for reply…!!
I had no knowledge of script structure, planning, etc. and found it very helpful.
Thank you for your question. We are creating an RP server, we envision the space to be like a weapons shop in GTA5 online. Therefore, we assume that you cannot take out weapons or attack anything. We thought this would deter trolling in the safe zone and give a sense of security like in the original GTA.
I am very grateful for your very informative opinion.
I will try this, but if you have any questions, may I ask? If you don’t mind, could you add me?
discord: emir.lua
Definitely feel free to ask questions, but honestly, im not really a discord guy; There are no stupid questions (so long as you’re making the effort!) - feel free to ask here!
Some useful natives that helped me restrict player control / movement:
RemoveAllPedWeapons
DisablePlayerFiring
DisableControlAction
DeleteEntity
Here are some for area locations:
GetDistanceBetweenCoords
IsEntityInAngledArea
IsEntityInArea
IsEntityInZone
GetRoomKeyFromEntity
GetInteriorAtCoords
There are others, but it depends - Everything always depends, LMFAOO
Thank you for reply!!
I don’t know where to start, can you tell me? How do I make use of those codes?
Good question - I’d say there’s a really good series on how to script here:
Shoutout to @CharlesHacks
Start on Episode 3 then watch Episode 5.
By then, you should have an idea of the general idea of how scripts work. From there, you’ll want to use the native reference here
To look up things that you’d want to collect about the player REGARDLESS of what design you take for your safezone. For example, in many cases, it’s a good idea to collect the player location, and weapon status of the player…Search the native link for things like “Location” and “Weapons” to see what functions come back!
Remember that different words may have the same meaning, so be sure to use sites like “thesaurus” or “google” (of course) to find different ways to say things, and different links to help you understand how to do certain things
Hopefully this helps you get started!
Thank you for your kind guidance! I will give it a try.
Keep us all posted!