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] 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 (6465)
[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 (5473)
[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 
SJIsNotHere (4432)
[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. (3705)
[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 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] 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 

Top posting users this week
Razor
[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 


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

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

Back to top

- Similar topics

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