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
» [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

» Fatal Force - F2
by [F2]M60^ Sat Feb 24, 2024 4:07 pm

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

» VKs and VCMP Previews
by SJHere 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 SJHere 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

» [Closed] Suggestion - We can change weather in props
by VK.Angel.OfDeath Sat Nov 18, 2023 8:45 am

» [Denied] Suggestion - Garbageman Job
by VK.Angel.OfDeath Sat Nov 04, 2023 8:27 pm

» Server Files (24/10/2023)
by VK.Angel.OfDeath Sun Oct 29, 2023 1:22 pm

» [Accepted] playaaa, ULK.Hulk. [M4]Halilibow - speed hacking in parkours
by VK.Angel.OfDeath Sun Oct 29, 2023 1:15 pm

» [Solved] Password Reset- TrapHole
by VK.Angel.OfDeath Sun Oct 29, 2023 1:13 pm

» [Solved] Request for Password Reset (2)
by VK.Angel.OfDeath Sat Oct 21, 2023 1:14 pm

» [Solved] Password Rest
by [RPG]G_man Thu Oct 05, 2023 9:07 pm

» [Noted] FPV Suggestion
by SJHere Sat Sep 02, 2023 8:31 pm

» [Solved] Pass Reset Application Foster^
by VK.Angel.OfDeath Fri Jul 28, 2023 12:00 pm

» Wanna start over again?
by palestrino Wed Jul 26, 2023 2:06 am

» hey guys <3
by D@Ch0uChI. Thu Jul 13, 2023 1:51 am

» [Solved] Stats Transfer
by SJHere Sat Jun 17, 2023 6:03 pm

» [Solved] Password Reset
by D4rKR420R Wed May 24, 2023 1:36 am

» Let's all gather after May in VKs
by Mike Sat May 20, 2023 4:55 pm

» [Denied] Player report - [ON]HunTinG
by D4rKR420R Tue May 02, 2023 5:25 am

» Hi halo here
by Alone Sun Apr 30, 2023 11:28 am

» An old Player Of Vks
by Alone Sat Apr 22, 2023 12:01 am

» [Bug Report] Bug in /domination - invisible bridge
by VK.Angel.OfDeath Wed Apr 19, 2023 3:38 pm

» [Noted] Bug Report - Zone
by LOGiC ™ Wed Mar 08, 2023 4:52 pm

» [Noted] Just Suggestion
by LOGiC ™ Wed Mar 08, 2023 4:11 pm

Top posters
ЧК. (8555)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
VK.Angel.OfDeath (6454)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
=SdS=KrlozZ... (6433)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
D4rKR420R (5469)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
=KF=Thunder^ (5405)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
Pavonis (5197)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
SJHere (4421)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
Emma (4261)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
Vipe[R] (3756)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 
47. (3704)
[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_lcap[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_voting_bar[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) I_vote_rcap 

Statistics
We have 1948 registered users
The newest registered user is احمد

Our users have posted a total of 217818 messages in 16809 subjects
Top posting users this month
No user

Top posting users this week
No user


[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace)

Go down

[HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace) Empty [HARD] Assign a unique variable value for each player! (Entering vehicles automatically like in /taxirace)

Post by VK.Angel.OfDeath Mon Jul 13, 2020 12:46 pm

Information
In this tutorial I will tell you how to assign a unique variable value to a player. This is used in events like /taxirace where players automatically enter a different vehicle depending on how many players there are in the property.

It can be applied to different things but has its limitations. There are other methods of course and I'll probably post them in the future.

Before starting
Read through these:

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


Shorter: [You must be registered and logged in to see this link.]
Longer (Property Variable section at the bottom): [You must be registered and logged in to see this link.]

Guide
Note that the indexes marked in green and used in red will be different for you most likely! So replace them with your own indexes by pressing /propedit and entering the pickups to get their index.

1. You need to have a variable that increases by 1 everytime someone enters your property. That variable can be /addchangevariablepickup var_count 1. Let's say this is Index 20 that is created.
2. Next we must give each player the current value of var_count into their own player variable: var_player_index. We do that by using /addplayervariablepickup var_player_index $var_count$. Let's say this is index 21 created.
3. Next we make an addtriggerpickup2 and include the indexes of both the pickups above: /addtriggerpickup2 20 21. Let's say this get index 22.
4. Then we do /setpropjoinpickup 22.

So far what are the results so? Every time a player joins the property: var_count will increase by 1 and the player variable (which is unique for the player) will get the current value of var_count. What this leads to is that each player will have a variable that is different from another player. Why do we want that? Because we can use that to force each player into a different vehicle.

5. Now let's create some enter vehicle pickups all going to a different vehicle index using: /addvehenterpickup <Vehicle Index>. Make one for each vehicle Index. The index of the pickups after getting created are 23 to 53 in this example.

6. Now each pickup should make it so you enter one vehicle. We want every player to enter a different one. To do this we use our player variable: var_player_index that will increase by one for each player.

To do this we set the conditions for the pickups:

/changepickupcondition 23 player_vehicle == ON_FOOT AND var_player_index == 1
/changepickupcondition 24 player_vehicle == ON_FOOT AND var_player_index == 2
......
/changepickupcondition 52 player_vehicle == ON_FOOT AND var_player_index == 29
/changepickupcondition 53 player_vehicle == ON_FOOT AND var_player_index == 30

7. Next we set the autotriggerpickup for each  /addvehenterpickup pickup which in my this case is 23 to 50

First we do a /addtriggerpickup and then we autotrigger it!
/addtriggerpickup 23 50

/autotriggerpickup 50 2 1 0


Now players will be teleported into a unique vehicle even if they exit.

The vehicle enter pickups can now be moved to a location like /gotoloc militaryglitch or you can use /setpickupfake so that players don't accidently enter them.


Problems:
- If a player leaves the property and over 30 people enter in total we will run out of runs but if you had enough and actually make it into a minigame players will not leave after the game has already been started.
VK.Angel.OfDeath
VK.Angel.OfDeath
Server Owner & Forum Admin
Server Owner & Forum Admin

Posts : 6454
Points : 9307
Reputation : 127
Join date : 2012-10-28
Age : 29
Location : Sweden

Back to top Go down

Back to top

- Similar topics

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