Leaderboard
Popular Content
Showing content with the highest reputation on 28/02/19 in all areas
-
2 points
-
السلام عليكم ورحمة الله وبرككاته ء اليوم جيت اسوي مود المود عبارة عن لوحة تعطي وشم للسيارة مقابل مبلغ من المال المهم~. معي مشاكل ببعض الاكواد الكود الاول وهو اعطاء وشم للسيارة عند الضغط علي الزر addEventHandler ( "onClientGUIClick",root, function ( ) if source == take then -- عند الضغط علي الزر حق اعطاء الوشم local vehicles = getElementsByType("vehicle") setVehiclePaintjob ( vehicles, paint ) -- ووظيفته يحدد رقم الوشم 1 او 2 او 3 = paint انا مسوي اديت بوكس اسمه end end ) مدري سويته بس ما يبي يظبط الكود الثاني هو سحب او اخذ فلوس من اللاعب الى هياخذ وشم addEventHandler ( "onClientGUIClick",root, function ( ) if source == take then getPlayerMoney ( ) takePlayerMoney ( 500000 ) end end ) طبعا كل الاكواد الى فيها المشكلة فى الكلنت مب السيرفر ياريت مساعدة يا شباب وشكرا =)1 point
-
Veja Esse Exemplo. Primeiro vai verificar se o elemento e veiculo e depois irá destruir. Não precisa ter nenhum jogador dentro, Qualquer veiculo que colidir com marcadorserá destruído. Marker = createMarker(-709.33514, 959.02051, 12.44914, "cylinder", 1.2, 0, 255, 0, 60) function Destruir_Vehicle (hitElement) if getElementType(hitElement) == "vehicle" then destroyElement(hitElement) end end addEventHandler("onMarkerHit", Marker, Destruir_Vehicle)1 point
-
Tente isso: local theMarker = createMarker (0, 0, 2.2, "cylinder", 1) function markerEnter (thePlayer) if isElementWithinMarker (thePlayer, markerEnter) then local vehicles = getElementsByType("vehicle") for i, v in ipairs (vehicles) do destroyElement(v) end end end addEventHandler( "onMarkerHit", theMarker, markerEnter)1 point
-
1 point
-
Client Side : function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 return guiSetPosition(center_window, x, y, false) end addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(397, 188, 501, 316, ".:[Paintjop System]:.", false) centerWindow(wnd) guiSetVisible(wnd, false) guiWindowSetMovable(wnd, false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "FF189FE5") label1 = guiCreateLabel(288, 56, 65, 21, "رقم الوشم :", false, wnd) guiSetFont(label1, "default-bold-small") paintjopE = guiCreateEdit(221, 50, 57, 32, "", false, wnd) guiEditSetMaxLength(paintjopE, 1) take = guiCreateButton(196, 102, 106, 48, "آخذ الوشم", false, wnd) guiSetFont(take, "default-bold-small") guiSetProperty(take, "NormalTextColour", "FF0CFE00") label2 = guiCreateLabel(10, 160, 481, 18, "---------------------------------------------------------------------------------------------------------------", false, wnd) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 77, 0, 252) guiLabelSetHorizontalAlign(label2, "center", false) guiLabelSetVerticalAlign(label2, "center") label3 = guiCreateLabel(64, 195, 379, 18, "لوحة آخذ وشم للسيارة", false, wnd) guiSetFont(label3, "default-bold-small") guiLabelSetColor(label3, 89, 193, 223) guiLabelSetHorizontalAlign(label3, "center", false) label4 = guiCreateLabel(64, 213, 379, 18, "لأخذ وشم للسيارة اكتب رقم الوشم من 1-3", false, wnd) guiSetFont(label4, "default-bold-small") guiLabelSetColor(label4, 40, 173, 211) guiLabelSetHorizontalAlign(label4, "center", false) label5 = guiCreateLabel(64, 231, 379, 18, "وأضغط علي زر آخذ الوشم وسوف يتم اعطائك وشم للسيارة", false, wnd) guiSetFont(label5, "default-bold-small") guiLabelSetColor(label5, 31, 136, 167) guiLabelSetHorizontalAlign(label5, "center", false) label6 = guiCreateLabel(10, 259, 481, 18, "---------------------------------------------------------------------------------------------------------------", false, wnd) guiSetFont(label6, "default-bold-small") guiLabelSetColor(label6, 77, 0, 252) guiLabelSetHorizontalAlign(label6, "center", false) guiLabelSetVerticalAlign(label6, "center") label7 = guiCreateLabel(180, 289, 140, 17, "For Wnash Time", false, wnd) guiSetFont(label7, "default-bold-small") guiLabelSetColor(label7, math.random(0,255),math.random(0,255),math.random(0,255)) guiLabelSetHorizontalAlign(label7, "center", false) label8 = guiCreateLabel(10, 27, 126, 19, "سعر الوشم : 500.000$", false, wnd) guiSetFont(label8, "default-bold-small") guiLabelSetColor(label8, 196, 0, 0) guiLabelSetHorizontalAlign(label8, "center", false) addEventHandler( "onClientGUIClick" , take , function( ) local paintJob = guiGetText( paintjopE ) if( tonumber( paintJob ) and tonumber( paintJob ) >= 0 and tonumber( paintJob ) <= 3 ) then triggerServerEvent( "changePaintJob" , localPlayer , paintJob ) else outputChatBox( "يرجي التحقق من رقم الوشم" , 255 , 0 , 0 , true ) end guiSetEnabled ( take , false ); setTimer ( guiSetEnabled ,5000 , 1 , take , true ); end , false ) end ) Server Side : addEvent( "changePaintJob" , true ) addEventHandler( "changePaintJob" , root , function( paintJob ) local vehicle = getPedOccupiedVehicle( source ) if( vehicle ) then if( getPlayerMoney( source ) >= 500000 ) then takePlayerMoney( source , 500000 ) setVehiclePaintjob( vehicle , paintJob ) outputChatBox("#FFFAAAPaintJob #FFFFFF:#00FF00 !تم اعطائك وشم للسيارة بنجاح",source,0, 255, 0, true) else outputChatBox( '#FFFAAAPaintJob #FFFFFF:#C10000 !ليس معك مال كافي لشراء الوشم' , source , 255 , 0 , 0 , true ) end else outputChatBox("#FFFAAAPaintJob #FFFFFF:#C10000 !يجب عليك ركوب السيارة لإعطائك وشم", source,255, 0, 0, true) end end ) بالتوفيق1 point
-
1 point
-
Seja mais especifico não entendi nem um pouco do que você quis dizer.1 point
-
كلنت addEventHandler ( "onClientGUIClick",root, function ( ) if source == take then -- عند الضغط علي الزر حق اعطاء الوشم local paintjobtext = guiGetText(paint) triggerServerEvent("onSetVehiclePaintJob",localPlayer, paintjobtext) end end ) سيرفر addEvent("onSetVehiclePaintJob",true) addEventHandler("onSetVehiclePaintJob",root, function( paintjobtext ) if isPedInVehicle(source) then if ( getPlayerMoney(source) >= 5000 ) then takePlayerMoney(source, 5000) local vehicle = getPedOccupiedVehicle(source) setVehiclePaintjob(vehicle,tonumber(paintjobetext)) outputChatBox("Done successfully to added the paintjob to your vehicle.", source,0,255,0,true) else outputChatBox("You don't have enough money.", source,255,0,0,true) end else outputChatBox("You must ride a vehicle to add paintjob.", source,255,0,0,true) end end ) سويته علسريع لاني ماشي بعد شوي ف ياريت لو فيه اي اخطاء احد ينبهني1 point
-
1 point
-
addCommandHandler( "an", function ( source, cmd, ... ) local message2 = #{...} > 0 and table.concat({...}," ") or nil if message2 then for _, p in ipairs (getElementsByType("player")) do if hasObjectPermissionTo(p, "command.mute", true) then outputChatBox("#ffffff[ #696969 Anônimo #ffffff] "..getPlayerName(source).."#696969 - "..message2, p, 255, 255, 255, true) else outputChatBox("#ffffff[ #696969 Anônimo #ffffff] #696969 - "..message2, p, 255, 255, 255, true) end end else outputChatBox( "[/"..cmd.."]: Digite uma mensagem!", source, 230, 20, 20 ) end end )1 point
-
1 point
-
getPedOccupiedVehicle سوي ترايقر للسيرفر وبعدين سوي تحقق اذا الاعب داخل سيارة ولا لا عن طريقـ واسحب الفلوس getPlayerMoney وبعدين سوي تحقق ان الاعب معاه فلوس عن طريق وبعدين حط لون وبس1 point
-
هممممممممممممممممممم انتا تقصد ان هو اسموا حلا ؟؟ ههههههههههههههه والله دا اللي فهمتوا1 point
-
Você pode usar alguns eventos Veja o exemplo abaixo. function BindK ( source ) if ( source ) then outputChatBox ( "TESTE", source, 231, 217, 176, true ) end end -- IRÁ ATIVAR A BIND ASSIM QUE O MOD FOR LIGADO function Bind_Start() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "K", "down", BindK) end end addEventHandler("onResourceStart", root, Bind_Start) -- IRÁ ATIVAR A BIND ASSIM QUE O JOGADOR ENTRAR NO SERVIDOR function onPlayerJoin() bindKey(source, "K", "down", BindK) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) -- IRÁ REMOVER A BIND ASSIM QUE DESLIGAR O MOD function Stop_Mod(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "K", "down", BindK) end end addEventHandler("onResourceStop", root, Stop_Mod) Não testado.1 point
-
السلام عليكم ورحمه الله وبركاتة اليوم الشرح عن فنكشن مهم ومعظم المبرمجين ما يدور عنوا executeBrowserJavascript صفحة الويكي | Wiki Page : https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript اولا : ما هو معني الفانكشن ؟؟ html الفنكشن عبارة ينفذلك امر من لغه الجافا سكريبت علي صفحة اكيد ما فهمت شئ بوضحلك ------------------------------------------------------------------------------------- ملاحظات لاستخدام الفانكشن : 1 - اول واهم شئ انك تكون عارف شوية للجافا سكريبت 2 - لا يمكنك استخدام الوظيفة الا مع الصفحات المحلية يعني مينفعش تعمل الوظيفة دي مع صفحة جوجل مثلا 3 - يجب ان تعلم ان الفانكشن لا يشتغل الا علي الصفحات المحلية المعرفة في الميتا لنتعتبر ان اسم صفحتك call.html meta.xml اذن هنستدعيها كدا في ملف الميتا <file src="call.html" /> تقوم باستدعاء الصفحة داخل السكريبت حقك ( في ملف الكلنت طبعا لانوا متصفح ) url = "http://mta/"..getResourceName(getThisResource()).."/call.html" وبكدا url = رابط صفحتك ( call.html اللي هي ) اولا : تنشا متصفح yourBrowser = guiCreateBrowser(...) ثانيا : تحمل الرابط لما المتصفح يتنشا addEventHandler( "onClientBrowserCreated", theBrowser, -- ايفينت عبارة عن اول ما المتصفح يتنشا يحصل الفنكشن function( ) -- فنكشن loadBrowserURL( source, url ) -- تحميل رابط الصفحة حقتنا end -- انهاء الفنكشن ) -- اغلاق الايفينت ------------------------------------------------------------------------------------- بس لازم تعرف شرح الساينتكس بتاع الفنكشن bool executeBrowserJavascript ( browser webBrowser, string jsCode ) webBrowser : المتصفح بتاعك jsCode : كود الجافا سكريبت بتاعك ( الوظيفة لو الارقيومنات بتاعتها صحيحة بترجعلك قيمة وهي ترو ولو العكس او حطيت متصفح فية رابط موقع غير محلي بيرجعلك فولس) : ملحوظة _____________________________________________________ تمام كدا فهمنا الساينتكس ونشوف شوية امثلة المثال الاول :اظهار اسم الاعب عند كتابة 1 في اف 8 call.html <html> <p id = "msg"> hello </p> </html> client.lua( او ايا كان اسمة المهم انوا يكون ملف كلينت ) local jsCode = 'var p = document.getElementById("msg") ; p.innerHTML = "hello" + " '.. getPlayerName(localPlayer)..'"' local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 0, 0, screenWidth-200, screenHeight-300, "Web Browser", false ) local browser = guiCreateBrowser( 0, 28, screenWidth-200, screenHeight-300, true, false, false, window ) local theBrowser = guiGetBrowser( browser ) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://mta/"..getResourceName(getThisResource()).."/call.html" ) end ) addCommandHandler( '1' , function( ) executeBrowserJavascript( theBrowser , jsCode ) end ) المثال الثاني : اخراج الكلام الموجود في مربع الكتابة بتاع صفحة الويب علي شات اللعبه call.html <html> <input id='edit' ; type='text' /> </html> client.lua local jsCode = [[ var editBox = document.getElementById( 'edit' ) function onPressEnter() { if( event.keyCode == 13 ) { mta.triggerEvent("output",editBox.value) } } editBox.addEventListener("keypress", onPressEnter ) ]] local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 0, 0, screenWidth-200, screenHeight-300, "Web Browser", false ) local browser = guiCreateBrowser( 0, 28, screenWidth-200, screenHeight-300, true, false, false, window ) local theBrowser = guiGetBrowser( browser ) addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://mta/"..getResourceName(getThisResource()).."/call.html" ) end ) addEventHandler( 'onClientBrowserDocumentReady' , theBrowser , function() executeBrowserJavascript(source,jsCode) end ) addEvent( 'output' , true ) addEventHandler( 'output' , root , function( msg ) outputChatBox(msg) end ) _______________________________________________________________________________________________________ المثال الثالث : عبارة عن انشاء وتغير لون الماركر من خلال صفحة ويب داخل اللعبه call.html <html> <p id = "msg"></p> <script> function func() { var c = event.keyCode if( c != 44 && c != 45 ) { if( c < 48 || c > 57 ) { event.returnValue = false } } if( c == 13 ) { mta.triggerEvent( 'createMarker' , document.getElementById("edit_Box").value ) } } function func2() { var c = event.keyCode if( c != 44 ) { if( c < 48 || c > 57 ) { event.returnValue = false } } if( c == 13 ) { mta.triggerEvent( 'changeMarker' , document.getElementById("color_Box").value ) } } </script> <strong><em>Enter Marker Position Here !! : </em></strong><input id = "edit_Box" style = "color:red" ; type = 'text' size = "50" onkeypress = "func()"> </input> <hr> <p id = "msg2"></p> <strong><em>Enter Marker Color Here !! : </em></strong><input id = "color_Box" style = "color:orange" ; type = 'text' size = "50" onkeypress = "func2()"> </input> </html> client.lua local screenWidth, screenHeight = guiGetScreenSize( ) local window = guiCreateWindow( 136, 131, 824, 468, "Web Browser", false ) local browser = guiCreateBrowser( 0, 28, screenWidth-200, screenHeight-300, true, false, false, window ) local theBrowser = guiGetBrowser( browser ) guiSetVisible( window , not guiGetVisible(window) ) visible = guiGetVisible(window) showCursor(visible) guiSetInputEnabled(visible) _Markers = { } addEventHandler( "onClientBrowserCreated", theBrowser, function( ) loadBrowserURL( source, "http://mta/"..getResourceName(getThisResource()).."/call.html" ) end ) setDevelopmentMode(true,true) addEvent( 'createMarker' , true ) addEventHandler( 'createMarker' , root , function( position ) if( #position == 0 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>يرجي كتابة احداثيات الماركر</u></i></b>" ; document.getElementById("msg").style.color="red"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) return end local pos = split( position , ',' ) mark = createMarker( pos[1] , pos[2] , pos[3] , 'cylinder' , 1 ) if( isElement(mark) and getElementType(mark)=='marker' ) then if( type( pos ) == 'table' and #pos == 3 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>تم انشاء الماركر بنجاح</u></i></b>" ; document.getElementById("msg").style.color="green"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) _Markers[#_Markers+1] = mark else executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>يرجي كتابة احداثيات صحيحة</u></i></b>" ; document.getElementById("msg").style.color="red"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) return end else executeBrowserJavascript( theBrowser , 'document.getElementById("msg").innerHTML = "<b><i><u>يرجي كتابة احداثيات صحيحة</u></i></b>" ; document.getElementById("msg").style.color="red"' ) if( isTimer( ti ) ) then killTimer( ti ) end ti = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg").innerHTML = "" ; document' ) return end end ) addEvent('changeMarker',true) addEventHandler( 'changeMarker' , root , function( color ) if( #color == 0 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>يرجي كتابة لون الماركر</u></i></b>" ; document.getElementById("msg2").style.color="red"' ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return end RGB = split(color,',') if( _Markers[#_Markers] and isElement( _Markers[#_Markers] ) and getElementType( _Markers[#_Markers] ) == 'marker' ) then if( type( RGB ) == 'table' and #RGB == 3 and tonumber(RGB[1])<=255 and tonumber(RGB[1])>=0 and tonumber(RGB[2])<=255 and tonumber(RGB[2])>=0 and tonumber(RGB[3])<=255 and tonumber(RGB[3])>=0 ) then executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>تم تغيير لون الماركر بنجاح</u></i></b>" ; document.getElementById("msg2").style.color="green"' ) setMarkerColor( _Markers[#_Markers] , RGB[1] , RGB[2] , RGB[3] ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return else executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>يرجي التأكد من البيانات</u></i></b>" ; document.getElementById("msg2").style.color="red"' ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return end else executeBrowserJavascript( theBrowser , 'document.getElementById("msg2").innerHTML = "<b><i><u>قم بأنشاء المأركر اولأ</u></i></b>" ; document.getElementById("msg2").style.color="red"' ) if( isTimer( t2 ) ) then killTimer( t2 ) end t2 = setTimer( executeBrowserJavascript , 2000 , 1 , theBrowser , 'document.getElementById("msg2").innerHTML = "" ; document' ) return end end ) bindKey( 'f7' , 'down' , function( ) guiSetVisible( window , not guiGetVisible(window) ) visible = guiGetVisible(window) showCursor(visible) guiSetInputEnabled(visible) end ) addCommandHandler( '1' , function( ) local x , y , z = getElementPosition( localPlayer ) setClipboard( x..','..y..','..z ) end ) addCommandHandler( '2' , function( ) if( _Markers[#_Markers] and isElement( _Markers[#_Markers] ) and getElementType( _Markers[#_Markers] ) == 'marker' ) then destroyElement( _Markers[#_Markers] ) _Markers[#_Markers] = nil local just = { } for i , data in pairs( _Markers ) do if( data ) then table.insert( just , data ) end end _Markers = just data = nil ; just = nil end end ) _______________________________________________________________________________________________________ >> { لأي استفسار تفضل في التعليقات في الاسفل } << ____________________________________ المصادر ____________________________________ https://wiki.multitheftauto.com/wiki/ExecuteBrowserJavascript https://www.w3schools.com/js/ https://wiki.multitheftauto.com/wiki/OnClientBrowserDocumentReady https://wiki.multitheftauto.com/wiki/OnClientBrowserCreated ______________________________________________ من قاموا بمساعدتي Who helped me ______________________________________________ @IIYAMA @botder ______________________________________________ الاهداءات @Master_MTA @!#DesTroyeR_,) @Default#^ @#,xiRocKyz @NX_CI @TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ @DABL @Kareem Amer والباقي في القلب1 point
-
بعض الصور من الكافيه اللي جالس فيه مقابل كوبري ستالي صور للميلفن كيك اللي جالس اكله0 points
