+Source|> Posted May 13, 2018 Share Posted May 13, 2018 كيف استعمل هذا اليوزفل function guiEditSetOnlyNumbers ( edit, boolean ) local function CheckNumbers ( ) local currText = guiGetText( source ) local newText = string.gsub( currText, '[^0-9]', '' ) if newText ~= currText then guiSetText( source, newText ) end end if edit and boolean then if getElementType ( edit ) == 'gui-edit' and type ( boolean ) == 'boolean' then if boolean == true then local CheckEventTrue = getEventHandlers( "onClientGUIChanged", edit ) for i, v in ipairs( CheckEventTrue ) do if v == CheckNumbers then removeEventHandler ( "onClientGUIChanged", edit, v ) break; end end addEventHandler ( "onClientGUIChanged", edit, CheckNumbers ) return true; else local CheckEventFalse = getEventHandlers( "onClientGUIChanged", edit ) for i, v in ipairs( CheckEventFalse ) do if v == CheckNumbers then addEventHandler ( "onClientGUIChanged", edit, v ) break; end end removeEventHandler ( "onClientGUIChanged", edit, CheckNumbers ) return true; end else error ( "ERROR : bad argument ".. getElementType ( edit ) == 'gui-edit' and "2" or "1" .." excepted '".. getElementType ( edit ) == 'gui-edit' and "boolean" or "gui-edit" .."' got ".. getElementType ( edit ) == 'gui-edit' and type ( boolean ) or getElementType ( edit ) ) return false; end else error ( "ERROR : bad argument ".. getElementType ( edit ) == 'gui-edit' and "2" or "1" .." excepted '".. getElementType ( edit ) == 'gui-edit' and "boolean" or "gui-edit" .."' got ".. getElementType ( edit ) == 'gui-edit' and type ( boolean ) or getElementType ( edit ) ) return false; end end Link to comment
SycroX Posted May 13, 2018 Share Posted May 13, 2018 On 13/05/2018 at 13:01, +Source|> said: كيف استعمل هذا اليوزفل function guiEditSetOnlyNumbers ( edit, boolean ) local function CheckNumbers ( ) local currText = guiGetText( source ) local newText = string.gsub( currText, '[^0-9]', '' ) if newText ~= currText then guiSetText( source, newText ) end end if edit and boolean then if getElementType ( edit ) == 'gui-edit' and type ( boolean ) == 'boolean' then if boolean == true then local CheckEventTrue = getEventHandlers( "onClientGUIChanged", edit ) for i, v in ipairs( CheckEventTrue ) do if v == CheckNumbers then removeEventHandler ( "onClientGUIChanged", edit, v ) break; end end addEventHandler ( "onClientGUIChanged", edit, CheckNumbers ) return true; else local CheckEventFalse = getEventHandlers( "onClientGUIChanged", edit ) for i, v in ipairs( CheckEventFalse ) do if v == CheckNumbers then addEventHandler ( "onClientGUIChanged", edit, v ) break; end end removeEventHandler ( "onClientGUIChanged", edit, CheckNumbers ) return true; end else error ( "ERROR : bad argument ".. getElementType ( edit ) == 'gui-edit' and "2" or "1" .." excepted '".. getElementType ( edit ) == 'gui-edit' and "boolean" or "gui-edit" .."' got ".. getElementType ( edit ) == 'gui-edit' and type ( boolean ) or getElementType ( edit ) ) return false; end else error ( "ERROR : bad argument ".. getElementType ( edit ) == 'gui-edit' and "2" or "1" .." excepted '".. getElementType ( edit ) == 'gui-edit' and "boolean" or "gui-edit" .."' got ".. getElementType ( edit ) == 'gui-edit' and type ( boolean ) or getElementType ( edit ) ) return false; end end Expand guiEditSetOnlyNumbers(yourEdit, true or false) yourEdit = الأديت حقك true = تخلي الأديت ارقام فقط false = تخليه كل شي Link to comment
+Source|> Posted May 13, 2018 Author Share Posted May 13, 2018 (edited) On 13/05/2018 at 13:18, #x1AhMeD,-09 said: guiEditSetOnlyNumbers(yourEdit, true or false) yourEdit = الأديت حقك true = تخلي الأديت ارقام فقط false = تخليه كل شي Expand طيب عندي مشكله ثانيه guiSetInputEnabled( true ) guiSetInputEnabled( false ) لما احطها في الكود واقفل اللوحه الماوس ما يختفي Edited May 13, 2018 by +Source|> Link to comment
Denay. Posted May 13, 2018 Share Posted May 13, 2018 guiEditSetOnlyNumbers(yourEdit, true or false) = function guiEditSetOnlyNumbers ( edit, boolean ) اتوقع ذلك . Link to comment
+Source|> Posted May 13, 2018 Author Share Posted May 13, 2018 On 13/05/2018 at 13:23, Denay. said: guiEditSetOnlyNumbers(yourEdit, true or false) = function guiEditSetOnlyNumbers ( edit, boolean ) اتوقع ذلك . Expand On 13/05/2018 at 13:20, +Source|> said: طيب عندي مشكله ثانيه guiSetInputEnabled( true ) guiSetInputEnabled( false ) لما احطها في الكود واقفل اللوحه الماوس ما يختفي Expand Link to comment
#\_oskar_/# Posted May 13, 2018 Share Posted May 13, 2018 اتاكد انك خافييها عند قفل اللوحه Link to comment
SycroX Posted May 13, 2018 Share Posted May 13, 2018 On 13/05/2018 at 13:26, +Source|> said: Expand وش دخل guiSetInputEnabled بالماوس ؟ استخدم showCursor Link to comment
+Source|> Posted May 13, 2018 Author Share Posted May 13, 2018 On 13/05/2018 at 13:37, #x1AhMeD,-09 said: وش دخل guiSetInputEnabled بالماوس ؟ استخدم showCursor Expand شف الكود addEvent("enabl", true) addEventHandler("enabl", root, function() if ( guiGetVisible ( mnwnd ) ) then guiSetVisible( mnwnd, false ) showCursor( false ) guiSetVisible( wndwar, false ) guiSetVisible( PanelsWnd, false ) guiSetInputEnabled( true ) else guiSetVisible( mnwnd, true ) showCursor( true ) guiSetInputEnabled( false ) guiEditSetOnlyNumbers( moneyallcountedit, true ) guiEditSetOnlyNumbers( moneytcountedit, true ) guiEditSetOnlyNumbers( moneyplayercountedit, true ) guiEditSetOnlyNumbers( wpidedit, true ) end end ) Link to comment
فاّرس Posted May 13, 2018 Share Posted May 13, 2018 (edited) تأكد أنك مسوي التريقر صح. == true وضيف للتحقق حق اللوحه Edited May 13, 2018 by Sha67 2 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