iPrestege Posted January 19, 2013 Share Posted January 19, 2013 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
Castillo Posted January 19, 2013 Share Posted January 19, 2013 Maybe if you could tell us what's the problem? Link to comment
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 Maybe if you could tell us what's the problem? dont work! Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 Post the full code so I can test on it. Link to comment
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 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
Castillo Posted January 19, 2013 Share Posted January 19, 2013 Could have posted the error from the beginning. You got two "and" instead of one, check "if" and "elseif" lines. Link to comment
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 (edited) 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 January 19, 2013 by Guest Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 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
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 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
Castillo Posted January 19, 2013 Share Posted January 19, 2013 Well, the problem is that you're checking only the last GUI element ( "Ver" ) if is visible or not. Link to comment
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 (edited) 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 January 19, 2013 by Guest Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 You didn't change anything? Link to comment
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 You didn't change anything? Ahh!, yes it,s visible . Ver = guiCreateLabel(0.10029282420874,0.76041668653488,0.81551975011826,0.23046875, "(V.2)", true) guiSetVisible ( Ver, false ) guiLabelSetColor(Ver, 0, 254, 233) Link to comment
|Mr|-Talal07-| Posted January 19, 2013 Share Posted January 19, 2013 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
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 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
===|OSAMA|=== Posted January 19, 2013 Share Posted January 19, 2013 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
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 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
===|OSAMA|=== Posted January 19, 2013 Share Posted January 19, 2013 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
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 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? Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 getTeam and count are custom functions? Link to comment
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 getTeam and count are custom functions? If possible! if it,s wrong what should i use? to get the team! Link to comment
Castillo Posted January 19, 2013 Share Posted January 19, 2013 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
iPrestege Posted January 19, 2013 Author Share Posted January 19, 2013 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 . Link to comment
franku Posted January 19, 2013 Share Posted January 19, 2013 what the name of this scripting tool? or downloading link! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now