Jump to content

Help with GUI LABEL


mcer

Recommended Posts

Posted

I can't put

local MilitaryCount = countPlayersInTeam ( Military ) 

In this GUIlabel (Don't appear when i put "MilitaryCount" in the code)

        MilitaryN = guiCreateLabel(104, 427, 70, 19, "Number", false, TeaSelectorWin) 
        guiLabelSetColor(MilitaryN, 106, 105, 109) 

I want to replace "number" With the number of a specific team.

Please help.

Posted
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 

Or:

guiSetText(MilitaryN, MilitaryCount) 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 

Or:

guiSetText(MilitaryN, MilitaryCount) 

It does not work. D:

Posted

-- # Client Side .. 
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    (       ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN,tostring ( Count ) ) 
    end 
) 

  

Posted
-- # Client Side .. 
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    (       ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN,tostring ( Count ) ) 
    end 
) 

Doesn't work too D:

Posted

It should work.

Make sure that 'MilitaryCount' is really returning the players in the team.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted (edited)

Debugscript:

Bad argument @ 'guiSetText [Expected gui-element at argument 1,got nil]

With this

-- # Client Side .. 
MilitaryN = guiCreateLabel(104, 427, 70, 19, MilitaryCount, false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    (       ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN,tostring ( Count ) ) 
    end 
) 

Edited by Guest
Posted

Debugscript tells me the error is here:

            guiSetText ( MilitaryN,tostring ( Count ) ) 

Bad argument @ 'guiSetText [Expected gui-element at argument 1,got nil]

Posted

try this:

MilitaryN = guiCreateLabel(104, 427, 70, 19, "", false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    ( ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN, Count  ) 
    end 
) 

Omerta Roleplay

Posted
try this:
MilitaryN = guiCreateLabel(104, 427, 70, 19, "", false, TeaSelectorWin) 
guiLabelSetColor(MilitaryN, 106, 105, 109) 
  
addEventHandler('onClientRender',root, 
    function    ( ) 
        local Count = countPlayersInTeam ( getTeamFromName ( 'Military' ) ) 
            guiSetText ( MilitaryN, Count  ) 
    end 
) 

Finally!!, Thanks all :mrgreen:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...