Jump to content

Help..! guiSetVisible and..


iPrestege

Recommended Posts

hi , i need help here what,s the wrong!

bindKey ( "F1" , "down" ,  
function() 
 if ( guiGetVisible ( GUIEditor_Window[1] ) and  ( guiGetVisible ( GUIEditor_Window[2] ) and  ( guiGetVisible ( GUIEditor_Window[3] ) == true ) then 
 guiSetVisible ( GUIEditor_Window[1] ,false ) 
 guiSetVisible ( GUIEditor_Window[2] ,false ) 
 guiSetVisible ( GUIEditor_Window[3] ,false ) 
 showCursor (false ) 
  
 elseif ( guiGetVisible ( GUIEditor_Window[1] ) and  ( guiGetVisible ( GUIEditor_Window[2] ) and ( guiGetVisible ( GUIEditor_Window[3] ) == false ) then 
 guiSetVisible ( GUIEditor_Window[1] ,true ) 
 guiSetVisible ( GUIEditor_Window[2] ,true ) 
 guiSetVisible ( GUIEditor_Window[3] ,true ) 
 showCursor (true) 
 end 
 end 
 ) 
  

Link to comment
Post the full code so I can test on it.

realy it,s hard to post the full script but i but my full code about guiSetVisible... and the error here:

Warning: Loading script failed: name/client.lua:342: unexpected symbol near "and"

full code =

bindKey ( "n" , "down" ,  
function() 
 if ( guiGetVisible ( Drift ) and  ( guiGetVisible ( War ) and  ( guiGetVisible ( Chose ) and  and  ( guiGetVisible ( Ver )== true ) then 
 guiSetVisible ( Drift ,false ) 
 guiSetVisible ( War ,false ) 
 guiSetVisible ( Chose ,false ) 
 guiSetVisible ( Ver ,false ) 
 fadeCamera(true) 
 showChat(true) 
 showCursor (false ) 
  
 elseif ( guiGetVisible ( Drift ) and  ( guiGetVisible ( War ) and  ( guiGetVisible ( Chose ) and  and  ( guiGetVisible ( Ver )== false ) then 
 guiSetVisible ( Drift ,true ) 
 guiSetVisible ( War ,true ) 
 guiSetVisible ( Chose ,true ) 
 guiSetVisible ( Ver ,true ) 
 fadeCamera(false) 
 showChat(false) 
 showCursor (true) 
 end 
 end 
 ) 

:)

Link to comment
Could have posted the error from the beginning.

You got two "and" instead of one, check "if" and "elseif" lines.

sorry my bad! and here new problem and dont work:(

bindKey ( "n" , "down" ,  
function() 
 if ( guiGetVisible ( Drift ) and  ( guiGetVisible ( War ) and  ( guiGetVisible ( Chose ) and   ( guiGetVisible ( Ver )== true ) then 
 guiSetVisible ( Drift ,false ) 
 guiSetVisible ( War ,false ) 
 guiSetVisible ( Chose ,false ) 
 guiSetVisible ( Ver ,false ) 
 fadeCamera(true) 
 showChat(true) 
 showCursor (false ) 
  
 elseif ( guiGetVisible ( Drift ) and  ( guiGetVisible ( War ) and  ( guiGetVisible ( Chose ) and  ( guiGetVisible ( Ver )== false ) then 
 guiSetVisible ( Drift ,true ) 
 guiSetVisible ( War ,true ) 
 guiSetVisible ( Chose ,true ) 
 guiSetVisible ( Ver ,true ) 
 fadeCamera(false) 
 showChat(false) 
 showCursor (true) 
 end 
 end 
 ) 

reason:Warning: Loading script failed: name/client.lua:347: expected symbol near "then"

Edited by Guest
Link to comment
bindKey ( "n" , "down" , 
    function ( ) 
        if ( guiGetVisible ( Drift ) and guiGetVisible ( War ) and guiGetVisible ( ChoseL ) and guiGetVisible ( Ver ) == true ) then 
            guiSetVisible ( Drift, false ) 
            guiSetVisible ( War, false ) 
            guiSetVisible ( ChoseL, false ) 
            guiSetVisible ( Ver, false ) 
            fadeCamera ( true ) 
            showChat ( true ) 
            showCursor ( false ) 
        elseif ( guiGetVisible ( Drift ) and guiGetVisible ( War ) and guiGetVisible ( ChoseL ) and guiGetVisible ( Ver ) == false ) then 
            guiSetVisible ( Drift, true ) 
            guiSetVisible ( War, true ) 
            guiSetVisible ( ChoseL, true ) 
            guiSetVisible ( Ver, true ) 
            fadeCamera ( false ) 
            showChat ( false ) 
            showCursor ( true ) 
        end 
    end 
) 

Link to comment
bindKey ( "n" , "down" , 
    function ( ) 
        if ( guiGetVisible ( Drift ) and guiGetVisible ( War ) and guiGetVisible ( ChoseL ) and guiGetVisible ( Ver ) == true ) then 
            guiSetVisible ( Drift, false ) 
            guiSetVisible ( War, false ) 
            guiSetVisible ( ChoseL, false ) 
            guiSetVisible ( Ver, false ) 
            fadeCamera ( true ) 
            showChat ( true ) 
            showCursor ( false ) 
        elseif ( guiGetVisible ( Drift ) and guiGetVisible ( War ) and guiGetVisible ( ChoseL ) and guiGetVisible ( Ver ) == false ) then 
            guiSetVisible ( Drift, true ) 
            guiSetVisible ( War, true ) 
            guiSetVisible ( ChoseL, true ) 
            guiSetVisible ( Ver, true ) 
            fadeCamera ( false ) 
            showChat ( false ) 
            showCursor ( true ) 
        end 
    end 
) 

my script work now but the key not work!i mean not binded! i don know why no errors!

Link to comment
Well, the problem is that you're checking only the last GUI element ( "Ver" ) if is visible or not.
  
bindKey ( "n" , "down" , 
    function ( ) 
        if ( guiGetVisible ( Drift ) and guiGetVisible ( War ) and guiGetVisible ( ChoseL ) and guiGetVisible ( Ver ) == true ) then 
            guiSetVisible ( Drift, false ) 
            guiSetVisible ( War, false ) 
            guiSetVisible ( ChoseL, false ) 
            guiSetVisible ( Ver, false ) 
            fadeCamera ( true ) 
            showChat ( true ) 
            showCursor ( false ) 
        elseif ( guiGetVisible ( Drift ) and guiGetVisible ( War ) and guiGetVisible ( ChoseL ) and guiGetVisible ( Ver ) == false ) then 
            guiSetVisible ( Drift, true ) 
            guiSetVisible ( War, true ) 
            guiSetVisible ( ChoseL, true ) 
            guiSetVisible ( Ver, true ) 
            fadeCamera ( false ) 
            showChat ( false ) 
            showCursor ( true ) 
        end 
    end 
) 
  

No Erros or Warnings .

Edited by Guest
Link to comment

Try this ^^

bindKey ( "F1" , "down" ,  
function() 
    if guiGetVisible ( GUIEditor_Window[1] ) == true and guiGetVisible ( GUIEditor_Window[2] ) == true and  ( guiGetVisible ( GUIEditor_Window[3] ) == true ) then 
        guiSetVisible ( GUIEditor_Window[1] ,false ) 
        guiSetVisible ( GUIEditor_Window[2] ,false ) 
        guiSetVisible ( GUIEditor_Window[3] ,false ) 
        showCursor (false ) 
    elseif  guiGetVisible ( GUIEditor_Window[1] )  == true and guiGetVisible ( GUIEditor_Window[2] )  == true and ( guiGetVisible ( GUIEditor_Window[3] ) == false ) then 
        guiSetVisible ( GUIEditor_Window[1] ,true ) 
        guiSetVisible ( GUIEditor_Window[2] ,true ) 
        guiSetVisible ( GUIEditor_Window[3] ,true ) 
        showCursor (true) 
    end 
end) 
  
  

Link to comment
Try this ^^
bindKey ( "F1" , "down" ,  
function() 
    if guiGetVisible ( GUIEditor_Window[1] ) == true and guiGetVisible ( GUIEditor_Window[2] ) == true and  ( guiGetVisible ( GUIEditor_Window[3] ) == true ) then 
        guiSetVisible ( GUIEditor_Window[1] ,false ) 
        guiSetVisible ( GUIEditor_Window[2] ,false ) 
        guiSetVisible ( GUIEditor_Window[3] ,false ) 
        showCursor (false ) 
    elseif  guiGetVisible ( GUIEditor_Window[1] )  == true and guiGetVisible ( GUIEditor_Window[2] )  == true and ( guiGetVisible ( GUIEditor_Window[3] ) == false ) then 
        guiSetVisible ( GUIEditor_Window[1] ,true ) 
        guiSetVisible ( GUIEditor_Window[2] ,true ) 
        guiSetVisible ( GUIEditor_Window[3] ,true ) 
        showCursor (true) 
    end 
end) 
  
  

dont work!

Link to comment
bindKey ( "n", "down", 
    function ( ) 
        if ( guiGetVisible ( Drift ) == true and guiGetVisible ( War ) == true and guiGetVisible ( ChoseL ) == true and guiGetVisible ( Ver ) == true ) then 
            guiSetVisible ( Drift, false ) 
            guiSetVisible ( War, false ) 
            guiSetVisible ( ChoseL, false ) 
            guiSetVisible ( Ver, false ) 
            fadeCamera ( true ) 
            showChat ( true ) 
            showCursor ( false ) 
        else 
            guiSetVisible ( Drift, true ) 
            guiSetVisible ( War, true ) 
            guiSetVisible ( ChoseL, true ) 
            guiSetVisible ( Ver, true ) 
            fadeCamera ( false ) 
            showChat ( false ) 
            showCursor ( true ) 
        end 
    end 
) 

Link to comment
bindKey ( "n", "down", 
    function ( ) 
        if ( guiGetVisible ( Drift ) == true and guiGetVisible ( War ) == true and guiGetVisible ( ChoseL ) == true and guiGetVisible ( Ver ) == true ) then 
            guiSetVisible ( Drift, false ) 
            guiSetVisible ( War, false ) 
            guiSetVisible ( ChoseL, false ) 
            guiSetVisible ( Ver, false ) 
            fadeCamera ( true ) 
            showChat ( true ) 
            showCursor ( false ) 
        else 
            guiSetVisible ( Drift, true ) 
            guiSetVisible ( War, true ) 
            guiSetVisible ( ChoseL, true ) 
            guiSetVisible ( Ver, true ) 
            fadeCamera ( false ) 
            showChat ( false ) 
            showCursor ( true ) 
        end 
    end 
) 

Thanks it works! (:

Link to comment
bindKey ( "n", "down", 
    function ( ) 
        if ( guiGetVisible ( Drift ) == true and guiGetVisible ( War ) == true and guiGetVisible ( ChoseL ) == true and guiGetVisible ( Ver ) == true ) then 
            guiSetVisible ( Drift, false ) 
            guiSetVisible ( War, false ) 
            guiSetVisible ( ChoseL, false ) 
            guiSetVisible ( Ver, false ) 
            fadeCamera ( true ) 
            showChat ( true ) 
            showCursor ( false ) 
        else 
            guiSetVisible ( Drift, true ) 
            guiSetVisible ( War, true ) 
            guiSetVisible ( ChoseL, true ) 
            guiSetVisible ( Ver, true ) 
            fadeCamera ( false ) 
            showChat ( false ) 
            showCursor ( true ) 
        end 
    end 
) 

Thanks it works! (:

Welcome Any Time !

Link to comment
local function getTeam(team) 
return getTeamFromName(team) 
end 
  
addEventHandler("onClientRender", root,  
function() 
  local team1 = getTeam("Players Drift") 
  local team2 = getTeam("Grove") 
  local team3 = getTeam("Police") 
  local team4 = getTeam("No Team") 
  local count1 = count("Players Drift") 
  local count2 = count("Grove") 
  local count3 = count("Police") 
  local count4 = count("No Team") 
  if count1 then 
    guiSetText( 
DriftPlayers, "Drift Players: " .. tonumber(count1)) 
  end 
  local counall = count2 + count3 + count4 
  if counall then 
    guiSetText( 
WarPlayers, "War Players: " .. tonumber(counall)) 
  end 
  end 
) 
  

what,s the problem here? :roll:

Link to comment
local function getTeam ( team ) 
    return getTeamFromName ( team ) 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local team1 = getTeam ( "Players Drift" ) 
        local team2 = getTeam ( "Grove" ) 
        local team3 = getTeam ( "Police" ) 
        local team4 = getTeam ( "No Team" ) 
        local count1 = countPlayersInTeam ( team1 ) 
        local count2 = countPlayersInTeam ( team2 ) 
        local count3 = countPlayersInTeam ( team3 ) 
        local count4 = countPlayersInTeam ( team3 ) 
        if ( count1 ) then 
            guiSetText (    DriftPlayers, "Drift Players: ".. tonumber ( count1 ) ) 
        end 
        local counall = ( count2 + count3 + count4 ) 
        if ( counall ) then 
            guiSetText ( WarPlayers, "War Players: ".. tonumber ( counall ) ) 
        end 
    end 
) 

Link to comment
local function getTeam ( team ) 
    return getTeamFromName ( team ) 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local team1 = getTeam ( "Players Drift" ) 
        local team2 = getTeam ( "Grove" ) 
        local team3 = getTeam ( "Police" ) 
        local team4 = getTeam ( "No Team" ) 
        local count1 = countPlayersInTeam ( team1 ) 
        local count2 = countPlayersInTeam ( team2 ) 
        local count3 = countPlayersInTeam ( team3 ) 
        local count4 = countPlayersInTeam ( team3 ) 
        if ( count1 ) then 
            guiSetText (    DriftPlayers, "Drift Players: ".. tonumber ( count1 ) ) 
        end 
        local counall = ( count2 + count3 + count4 ) 
        if ( counall ) then 
            guiSetText ( WarPlayers, "War Players: ".. tonumber ( counall ) ) 
        end 
    end 
) 

Thank You very much :D.

Link to comment

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