VKs Official Server
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Latest topics
» Omg this server with the website is still alive :o
by Razor Tue Nov 19, 2024 10:17 pm

» [Solved] Help & Support
by VK.Angel.OfDeath Thu Oct 24, 2024 7:02 pm

» [Solved] reset password
by VK.Angel.OfDeath Thu Oct 24, 2024 6:58 pm

» [Accepted] Report - Abanoub^
by VK.Angel.OfDeath Thu Oct 24, 2024 6:42 pm

» [Accepted] Unban appeal - hasan
by D4rKR420R Fri Oct 18, 2024 10:06 pm

» [Solved] Report - BelondiOscar
by SJIsNotHere Fri Oct 11, 2024 1:21 pm

» [Solved] Geogeo - Stats Transfer
by SJIsNotHere Tue Oct 01, 2024 5:50 pm

» [Solved] Kindly Re-solve it
by SJIsNotHere Wed Sep 25, 2024 9:55 am

» [Solved] Geogeo - Stats Transfer
by SJIsNotHere Wed Sep 25, 2024 8:10 am

» Matija_Todorovic returns after 3 years of absence
by UmaR Sun Sep 01, 2024 5:55 am

» [Solved] Signature^-Stats transfer
by UmaR Wed Aug 21, 2024 2:38 pm

» [Denied] Admin Application - MK14
by UmaR Fri Aug 16, 2024 8:44 pm

» [Solved] Reset my password pls
by VK.Angel.OfDeath Wed Aug 14, 2024 6:44 am

» Old member back from the dead
by Neptune Mon Aug 12, 2024 9:39 pm

» Vice War X Gameplay | BadDiamondArtz VCMP
by UmaR Thu Jul 18, 2024 10:00 am

» [Solved] RESET PASSWORD
by UmaR Fri Jul 12, 2024 3:29 pm

» [Solved]Transfer Application - Hazard
by SJIsNotHere Wed Jul 03, 2024 10:56 am

» DARKRAZOR RESPONDE MI MENSAJE!!!
by Veterano789 Wed Jul 03, 2024 1:59 am

» Vice War X: The Starfish Showdown
by =FF=B00M_B00M^ Thu Jun 27, 2024 6:17 pm

» Fatal Force - F2
by Mr.Moon Wed Jun 26, 2024 7:18 am

» Stat Transfer Application - SuFyastiC
by D4rKR420R Tue Jun 04, 2024 10:07 pm

» [Accepted] Unban Appeal
by VK.Angel.OfDeath Sun Mar 31, 2024 8:29 am

» [Solved] Password Reset
by VK.Angel.OfDeath Sat Mar 23, 2024 9:32 pm

» Ramadan Mubarak in Advance
by Shafin Sat Mar 23, 2024 1:52 pm

» Illegal Immigration | Old Memories | 2017
by ilemius Fri Feb 09, 2024 5:25 pm

» VKs and VCMP Previews
by SJIsNotHere Sat Jan 20, 2024 1:51 pm

» The Resurgence 4th Year of Anniversary!
by Ninja Tue Jan 16, 2024 10:30 am

» [Solved]Stats Transfer application - Shado[W]^
by SJIsNotHere Mon Nov 27, 2023 5:06 pm

» Hi to all my good friends
by VK.Angel.OfDeath Sat Nov 18, 2023 9:04 am

» [Closed] Admin Application - F2.Ninja
by VK.Angel.OfDeath Sat Nov 18, 2023 8:49 am

Top posters
ЧК. (8555)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
VK.Angel.OfDeath (6465)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
=SdS=KrlozZ... (6433)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
D4rKR420R (5473)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
=KF=Thunder^ (5405)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
Pavonis (5197)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
SJIsNotHere (4432)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
Emma (4261)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
Vipe[R] (3756)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 
47. (3705)
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 

Statistics
We have 1978 registered users
The newest registered user is kodaklyve

Our users have posted a total of 217905 messages in 16831 subjects
Top posting users this month
Razor
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 

Top posting users this week
Razor
[HARD] How to check if a player is in an area? I_vote_lcap[HARD] How to check if a player is in an area? I_voting_bar[HARD] How to check if a player is in an area? I_vote_rcap 


[HARD] How to check if a player is in an area?

4 posters

Go down

[HARD] How to check if a player is in an area? Empty [HARD] How to check if a player is in an area?

Post by VK.Angel.OfDeath Fri Jul 31, 2020 4:25 pm

Information
This tutorial will tell you how to check if a player is inside a squared area.

Explanation
Under me, you see a square. Most areas (unless you need to be extremely specific) can be divided into a square.

[You must be registered and logged in to see this image.]

As you can see from this picture the square has 4 corners. Those corners will be used to check if a player is in an area.

1. So the first thing you want to do is find a nice area for example the bank. It's bottom room is basically a big square. Go to all the 4 corners of the bank and do /s.

This will give you the x,y,z coordinates.

2. Next determine out of those 4 cases the maximum and minimum value for x and y coordinates. If your values are:

10.33 -9.33
11.33 -101.33
12.33 -11.33
13.33 -43.33

Your minimum x coordinate is: 10.33
Your maximum x coordinate is: 13.33

Since Y is negative you gotta remember your basic math. Basically everything is reverse when it comes to negative numbers. -1 is bigger than -1000000.

Your minimum y is
: -101.33
Your maximum y is: -9.33 (-9.33 is bigger than the number numbers).


3. Next make a pickup. In this example I will keep it simple:

Pickup Index 0: /addmsgpickup You're in the bank.
Pickup index 1: /addmsgpickup You're not in the bank.

4. Next bind them to a command.
/changepickupcommand 0 test
/changepickupcommand 1 test

Now when you type /p test you will see both messages.

5. Next we define the conditions. A player position has to be between the x max and min value AND between the y max and y min value for the player to be in the area.

Add this condition for the "is in bank" message to appear.

/changepickupcondition player_pos_x >= x_min AND player_pos_x <= x_max AND player_pos_y >= y_min AND player_pos_y <= y_max

Which in this case will be:

/changepickupcondition player_pos_x >= 10.33 AND player_pos_x <= 13.33 AND player_pos_y >= -101.33 AND player_pos_y <= -9.33


5.1.

Add this condition for the "is not in bank" message to appear.

A condition can easily be converted to it's opposite by replacing AND with OR and reversing all the directions of the checks. >= becomes <. == would become != and so on.

/changepickupcondition player_pos_x < x_min OR player_pos_x > x_max OR player_pos_y < y_min OR player_pos_y > y_max

Which in this case will be:

/changepickupcondition player_pos_x < 10.33 AND player_pos_x > 13.33 AND player_pos_y < -101.33 AND player_pos_y > -9.33


Now when you type /p test this should work if you use your own values of course. The values here are just random







_______________________________________
[You must be registered and logged in to see this image.]
VK.Angel.OfDeath
VK.Angel.OfDeath
Server Owner & Forum Admin
Server Owner & Forum Admin
Chuck Norrised
You been norrised.

Posts : 6465
Points : 9322
Reputation : 127
Join date : 2012-10-28
Age : 30
Location : Sweden

Back to top Go down

[HARD] How to check if a player is in an area? Empty Re: [HARD] How to check if a player is in an area?

Post by SuFyastiC Fri Jul 31, 2020 5:04 pm

Cool bro.
SuFyastiC
SuFyastiC
Ultra Legendary

Gender : Male
Posts : 2125
Points : 2790
Reputation : 20
Join date : 2013-07-04
Age : 27
Location : Karachi,Pakistan

Back to top Go down

[HARD] How to check if a player is in an area? Empty Re: [HARD] How to check if a player is in an area?

Post by MeLoDy^ Fri Jul 31, 2020 6:02 pm

VK.SuFyastiC wrote:Cool bro.
MeLoDy^
MeLoDy^
Legendary Member
Legendary Member

Gender : Male
Posts : 1150
Points : 1647
Reputation : 5
Join date : 2018-12-10
Age : 20
Location : East Side.

Back to top Go down

[HARD] How to check if a player is in an area? Empty Re: [HARD] How to check if a player is in an area?

Post by Pavonis Sat Aug 01, 2020 4:16 am

This actually belongs to Easy variables. Razz Razz Thanks for the lessons tho. study
Pavonis
Pavonis
Ultra Legendary

Gender : Male
Posts : 5197
Points : 5949
Reputation : -36
Join date : 2017-01-28
Age : 21
Location : In your home :3

Back to top Go down

[HARD] How to check if a player is in an area? Empty Re: [HARD] How to check if a player is in an area?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum