Results 1 to 6 of 6
  1. #1
    ShitFucks's Avatar
    Join Date
    Nov 2014
    Gender
    female
    Posts
    79
    Reputation
    10
    Thanks
    259

    Each variable gets a player?

    Basically what I'm wanting to do it have a variable clone itself for the number of players, and set each clone to a player. Can anyone tell me how to do this?

    var[1] = Player1
    var[2] = Player2

  2. #2
    tdsx's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Posts
    255
    Reputation
    10
    Thanks
    1,004
    Code:
    local players = player.GetAll()

  3. #3
    ShitFucks's Avatar
    Join Date
    Nov 2014
    Gender
    female
    Posts
    79
    Reputation
    10
    Thanks
    259
    Quote Originally Posted by tdsx View Post
    Code:
    local players = player.GetAll()
    I feel like an idiot for not thinking of that but basically what I'm trying to do is modify a menu to include all players and when you select a player it displays their money below the name. I don't know how to properly modify it. I'm new to lua and I'm working my way up the ladder.

    Code:
    	scrubs = player.GetAll()
    	local hitLab = vgui.Create( "DLabel", hitFrame )
    	hitLab:SetPos( hitFrame:GetWide() / 2 - 87 / 2, 35 )
    	hitLab:SetFont( "ChatFont" )
    	hitLab:SetTextColor( Color( 51, 204, 255, 255 ) )
    	hitLab:SetText( "Place Hit On:" )
    	hitLab:SizeToContents()
    
    	local hitBox = vgui.Create( "DComboBox", hitFrame )
    	hitBox:SetPos( hitFrame:GetWide() / 2 - 50, 55 )
    	hitBox:SetSize( 100, 20 )
    			hitBox:AddChoice( scrubs )
    (Yes, I snagged the menu from a hitman addon because I'm shit)

  4. #4
    Kona-chan's Avatar
    Join Date
    Oct 2014
    Gender
    female
    Posts
    380
    Reputation
    22
    Thanks
    685
    Quote Originally Posted by ShitFucks View Post
    I feel like an idiot for not thinking of that but basically what I'm trying to do is modify a menu to include all players and when you select a player it displays their money below the name. I don't know how to properly modify it. I'm new to lua and I'm working my way up the ladder.

    Code:
    	scrubs = player.GetAll()
    	local hitLab = vgui.Create( "DLabel", hitFrame )
    	hitLab:SetPos( hitFrame:GetWide() / 2 - 87 / 2, 35 )
    	hitLab:SetFont( "ChatFont" )
    	hitLab:SetTextColor( Color( 51, 204, 255, 255 ) )
    	hitLab:SetText( "Place Hit On:" )
    	hitLab:SizeToContents()
    
    	local hitBox = vgui.Create( "DComboBox", hitFrame )
    	hitBox:SetPos( hitFrame:GetWide() / 2 - 50, 55 )
    	hitBox:SetSize( 100, 20 )
    			hitBox:AddChoice( scrubs )
    (Yes, I snagged the menu from a hitman addon because I'm shit)
    make a picture in paint, your explainations aren't clear enough

  5. #5
    ShitFucks's Avatar
    Join Date
    Nov 2014
    Gender
    female
    Posts
    79
    Reputation
    10
    Thanks
    259
    Quote Originally Posted by Kona-chan View Post
    make a picture in paint, your explainations aren't clear enough
    A menu similar to this except only two entry boxes and the total at the bottom that will display the currently selected player's money. I don't need you to make the menu for me, I can do that. I just need to know how to make it update showing the selected player's money in the total section.



  6. #6
    D3M0L1T10N's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    1,364
    Reputation
    19
    Thanks
    656

Similar Threads

  1. (HELP!) Define Variable For Certain Players (HELP!)
    By Pete8497 in forum Call of Duty Modern Warfare 2 Help
    Replies: 8
    Last Post: 08-16-2010, 06:17 PM
  2. How i get that Player Info thingy?
    By Massive in forum CrossFire Help
    Replies: 1
    Last Post: 07-19-2010, 04:37 PM
  3. [AssaultCube]Get local player entity
    By Retoxified in forum C++/C Programming
    Replies: 1
    Last Post: 04-04-2010, 10:24 PM
  4. Does a name change gets a player cbl clean again?
    By mundi006 in forum Combat Arms Help
    Replies: 8
    Last Post: 09-14-2009, 07:28 PM
  5. [TuT] How to get Flash Player 7
    By Juliandil in forum BattleOn Games Hacks, Cheats & Trainers
    Replies: 6
    Last Post: 03-11-2008, 04:44 AM