- 
                
Posts
2,711 - 
                
Joined
 - 
                
Days Won
42 
Everything posted by Abdul KariM
- 
	addEventHandler("onClientGUIClick", resourceRoot , function( ) if ( source == اسم الزر ) then guiSetVisible( اسم اللوحة , false ) showCursor( false ) end end );
 - 
	طيب لازم الايفنت يكون سيرفر ؟ لاني جربته على الكلينت و ما ضببط لا موب لازم Marker = createMarker ( ... ) setElementAlpha( Marker , 0 ) -- 0 مخفي -- 255 ظاهر addEventHandler("onClientMarkerHit",root, function ( Hit ) if ( Hit == NameThePed ) and ( getElementType ( Hit ) == "Ped" ) then if NameThePed and isElement ( NameThePed ) then setElementRotation ( ... ) end end end ); لو تبي تستخدم كودي حق السيرفر انسخه من جديد عدلت فيه شي بسيط
 - 
	^ معلوماتك غلط ليه حاط لك فنكشن getElementType Marker = createMarker ( ... ) setElementAlpha( Marker , 0 ) -- 0 مخفي -- 255 ظاهر addEventHandler("onMarkerHit",root, function ( Hit ) if ( source == Marker ) and ( getElementType ( Hit ) == "Ped" ) then if NameThePed and isElement ( NameThePed ) then setElementRotation ( ... ) end end end );
 - 
	تقدر تسوي ماركر وتخفيه createMarker onMarkerHit -- Event getElementType setElementRotation setElementAlpha -- 0 تخفي الماركر
 - 
	+ لازم يتحقق ان الادمن معه ميوت isPlayerMuted ويتحقق انه ادمن getPlayerAccount isObjectInACLGroup getAccountName aclGetGroup
 - 
	^ addEventHandler ( "onClientPedWasted", root, function () if ( source == ped1 ) then setTimer ( function ( ) ped1 = createPed ( ... ) setElementDimension ( ped1, 1001 ) setPedAnimation ( ped1, "ped", "WALK_old" ) end , 2000 , 1 ) end if ( source == ped2 ) then setTimer ( function ( ) ped2 = createPed ( ... ) setElementDimension ( ped2, 1001 ) setPedAnimation ( ped2, "ped", "WALK_old" ) end , 2000, 1 ) end end );
 - 
	كلينت local Vehicles = { { "Alpha", 602, "1000" }, { "Banshee", 429, "2000" }, { "Buffalo", 402, "3000" }, { "Bullet", 541, "4000" }, { "Cheetah", 415, "5000" }, { "Comet", 480, "6000" }, { "Elegy", 562, "7000" }, { "Euros", 587, "8000"}, { "Flash", 565, "9000"}, { "Jester", 559, "10000" }, { "Phoenix", 603, "20000" }, { "Sultan", 560, "30000" }, { "Super GT", 506, "40000" }, { "Turismo", 451, "50000" }, { "Uranus", 558, "60000" }, { "NRG-500", 522, "70000" }, { "Infernus", 411, "80000" }, } for i,v in ipairs ( Vehicles ) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, 1, tostring(v[1]) , false , false ) guiGridListSetItemText ( grid, row, 2, v[2] , false , false ) guiGridListSetItemText ( grid, row, 3, tostring(v[3]) , false , false ) guiGridListSetItemColor ( grid, row, 2, 0, 255, 0) guiGridListSetItemData ( grid, row, 2, v[2] ) end addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == GUIEditor.button[1] ) then if ( guiGridListGetSelectedItem ( grid ) ~= -1 ) then local Money = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 3 ) local iD = guiGridListGetItemData( grid, guiGridListGetSelectedItem( grid ), 2 ) if ( Money ~= '' and iD ~= '' ) then triggerServerEvent ( "Cars", localPlayer, iD, Money ) guiSetVisible( wnd, false ) showCursor ( false ) end else outputChatBox ( "* الرجاء اختيار سيارهـ", 255, 255, 255, true ) end end end ) سيرفر local Vehicle = { }; addEvent ( "Cars", true ) addEventHandler ( "Cars", root, function ( iD, Money ) if ( getPlayerMoney ( source ) >= tonumber( Money ) ) then takePlayerMoney ( source, tonumber( Money ) ) outputChatBox ( "* [ ".. tonumber( Money ) .." ] بـ هذا المبلغ [ "..getVehicleNameFromID ( iD ).." ] لقد اشتريت السيارهـ", source, 0, 255, 0, true ) else outputChatBox ( "* لا تملك المال الكافي لـ شراء سيارهـ", source, 255, 0, 0, true ) end if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( iD, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) end )
 - 
	local Vehicle = { }; addEvent ( "Cars", true ) addEventHandler ( "Cars", root, function ( iD, Money, player ) if ( getPlayerMoney ( player ) >= tonumber ( Money ) ) then takePlayerMoney ( player, tonumber ( Money ) ) outputChatBox ( "* [ "..tonumber ( Money ).." ] بـ هذا المبلغ [ "..getVehicleNameFromID ( iD ).." ] لقد اشتريت السيارهـ", player, 0, 255, 0, true ) else outputChatBox ( "* لا تملك المال الكافي لـ شراء سيارهـ", player, 255, 0, 0, true ) end if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( player ) Vehicle[source] = createVehicle ( iD, x, y, z ) warpPedIntoVehicle ( player, Vehicle[source] ) end )
 - 
	شكرا لك على فنكشناتها بس ما قلتلي كيف استخدمها لمود ,,كيف احفظ الاشياء للمود ؟ شف شرح تيتي والملفات حقت الحفظ نوعها سيرفر سايد فقط اذا ماعرفت للاس كيو لايت عندك الاكونت داتا سهل وفي شرح مسويه ذا بيست بقسم شروحات البرمجة setAccountData getAccountData هذي تخزن البيانات على الحساب الخاص بالاعب بالتوفيق ان شاء الله
 - 
	^ لا مالها شغل كودي مجربه وشغال ومافيه اي خطأ تأكد انك متأكد من الميتا وانواع الملفات لاني حاطها مع الترايقر فهمت علي
 - 
	العفو , الله يهديك شوف زين ض1
 - 
	الاخ برستيج موجود كلمه يمكن عنده نسخة من السكربت يرفعها لك على موقع ثاني
 - 
	عليكم السلام هذي زي مانقول قاعدة بيانات تحفظ فيها الي تبي هذي فنكشناتها https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#SQL_functions وهذي شرح للاس كيو لايت من تيتي عمر https://forum.multitheftauto.com/viewtopic.php?f=164&t=56729 بالتوفيق
 - 
	X انت تعطيه السياره في كلنت يعني محد يشوفها الا هو سيارهه وهميه عموماً هذا الكود من جانب كلينت local Marker = createMarker ( 220.34393310547, 1921.0068359375, 16.640625, "cylinder", 1, 47, 0, 255 ) GUIEditor = { button = {}, window = {}, } Window = guiCreateWindow ( 341, 214, 357, 248, "لوحة المواتر الخاص بك | Server ProGamer", false ) guiWindowSetSizable ( Window, false ) guiSetVisible ( Window, false ) Button1 = guiCreateButton ( 56, 40, 233, 59, "مركبة | Vehicle", false, Window ) Button2 = guiCreateButton ( 55, 110, 235, 54, "دراجة نارية | Motorcycle", false, Window ) Button3 = guiCreateButton ( 56, 172, 236, 50, "دبابة | Tank", false, Window ) addEventHandler ( "onClientMarkerHit", resourceRoot, function ( player ) if getElementType ( player ) and ( source == Marker ) then guiSetVisible ( Window, true ) showCursor ( true ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function( ) if ( source == Button1 ) then triggerServerEvent ( "Car1", localPlayer ) elseif ( source == Button2 ) then triggerServerEvent ( "Car2", localPlayer ) elseif ( source == Button3 ) then triggerServerEvent ( "Car3", localPlayer ) end end ) addEvent ( "CloseWindow", true ) addEventHandler ( "CloseWindow", root, function ( ) guiSetVisible ( Window, false ) showCursor ( false ) end ) وهذا الكود من جانب سيرفر local Vehicle = { } addEvent ( "Car1", true ) addEventHandler ( "Car1", root, function ( ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( هنا تحط ايدي السياره الاولى الي تبيها, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) outputChatBox ( "* تم اعطاؤك مركبة", source, 255, 255, 255, true ) if ( isPedInVehicle ( source ) ) then triggerClientEvent ( source, "CloseWindow", source ) end end ) addEvent ( "Car2", true ) addEventHandler ( "Car2", root, function ( ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( هنا تحط ايدي السياره الاولى الي تبيها, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) outputChatBox ( "* تم اعطاؤك دراجة نارية", source, 255, 255, 255, true ) if ( isPedInVehicle ( source ) ) then triggerClientEvent ( source, "CloseWindow", source ) end end ) addEvent ( "Car3", true ) addEventHandler ( "Car3", root, function ( ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( هنا تحط ايدي السياره الاولى الي تبيها, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) outputChatBox ( "* تم اعطاؤك دبابة", source, 255, 255, 255, true ) if ( isPedInVehicle ( source ) ) then triggerClientEvent ( source, "CloseWindow", source ) end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) ملاحظه : ماني متاكد من ملف سيرفر اكوادك صحيحة بس لو نختصرها بترايقر واحد ومع ايديات مختلفة يكون افضل كلينت local Marker = createMarker ( 2045.46753, 1535.68384 ,10.67188, "cylinder", 1, 47, 0, 255 ) GUIEditor = { button = {}, window = {}, } Window = guiCreateWindow ( 341, 214, 357, 248, "لوحة المواتر الخاص بك | Server ProGamer", false ) guiWindowSetSizable ( Window, false ) guiSetVisible ( Window, false ) Button1 = guiCreateButton ( 56, 40, 233, 59, "مركبة | Vehicle", false, Window ) Button2 = guiCreateButton ( 55, 110, 235, 54, "دراجة نارية | Motorcycle", false, Window ) Button3 = guiCreateButton ( 56, 172, 236, 50, "دبابة | Tank", false, Window ) addEventHandler ( "onClientMarkerHit", resourceRoot, function ( player ) if getElementType ( player ) and ( source == Marker ) then guiSetVisible ( Window, true ) showCursor ( true ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function( ) if ( source == Button1 ) then id = 500 -- حط الايدي الي تبيه triggerServerEvent ( "Car", localPlayer , id ) elseif ( source == Button2 ) then id = 569 -- حط الايدي الي تبيه triggerServerEvent ( "Car", localPlayer , id ) elseif ( source == Button3 ) then id = 547 -- حط الايدي الي تبيه triggerServerEvent ( "Car", localPlayer , id ) end end ) addEvent ( "CloseWindow", true ) addEventHandler ( "CloseWindow", root, function ( ) guiSetVisible ( Window, false ) showCursor ( false ) end ) سيرفر local Vehicle = { } addEvent ( "Car", true ) addEventHandler ( "Car", root, function ( id ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) end local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) outputChatBox ( "* تم اعطاؤك مركبة", source, 255, 255, 255, true ) if ( isPedInVehicle ( source ) ) then triggerClientEvent ( source, "CloseWindow", source ) end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( Vehicle[source] ) and isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end )
 - 
	تأكد انك ضايف كود الضغط على الزر وفيه ترايقر addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then triggerServerEvent("givewep",localPlayer) end end ) ;
 - 
	
Lua Programing Book | Lua كتاب تعلم لغة
Abdul KariM replied to nxFairlywell's topic in دروس في البرمجة
 - 
	طيب بضيفه هذا هو ؟ addEventHandler("onClientGUIClick",الزر هنا,xMainFunctions_,false); يب بالضبط واسم الزر حق شراء الرتبة #
 - 
	الله يعطييك ألف عافيه وسلمت ايديك عالحل بس ممكن تقلي وش كان الخطأ عالعموم تمت الافاده من قبل عبد الكريم شكرا أخوي عندك المشكلة كانت في السطر ذا local sValue = getElementData( source,'Time' ) Time = اسم الداتا الي بالسكور بورد السكربت يجيب الداتا عن طريق السكوربورد " التاب " وبعدين يشوف الوقت هل هو المطلوب ولا لا كانت عندك الداتا بهذا الشكل local sValue = getElementData( source,'PlayTime' ) وفي السكوربورد موجودة بأسم Time كذا مافي وجود للداتا وعشان كذا يقولك ماعندك ساعات وانت عندك اتمنى انك فهمت ض1 وحياك الله في اي وقت
 - 
	^ لانك ماضفت حدث الضغط على الزر في فنكشن xMainFunctions_
 - 
	^ تفضل جرب function revmoeOtherGroups ( element ) if ( element and isElement ( element ) ) then if ( getPlayerAccount ( element ) and not isGuestAccount ( getPlayerAccount ( element ) ) ) then for _, v in ipairs( aclGroupList ( ) ) do if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( element ) ), v ) ) then aclGroupRemoveObject ( v, "user."..getAccountName ( getPlayerAccount ( element ) ) ) end end end end end addEvent("Buy",true) addEventHandler("Buy",root, function ( Group,Price,Name ) local account = getAccountName(getPlayerAccount(source)); if isObjectInACLGroup("user."..account,aclGetGroup("Admin-X")) then outputChatBox("#ffffff[buy Admin] #ff0000 انت مخالف !",source,255,0,0,true) return false end if isGuestAccount(getPlayerAccount(source)) then return false end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return false end local sValue = getElementData( source,'Time' ) if not sValue then sValue = '0:0:0' end local data = split(sValue,':') local hour = tonumber( data[1] ) if hour == nil or not tonumber(hour) then hour = 0 end if ( hour >= tonumber(Price)) then revmoeOtherGroups(source) aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("#ffffff[buy Admin] #ff0000تم شراء رتبه :"..Name,source,0,255,0,true); else outputChatBox("#ffffff[buy Admin] #ff0000ليس لديك ساعات كافية لشراء هاذه الرتبه",source,255,0,0,true); end end )
 - 
	^ سكربت الساعات وش يطلع بالتاب كذا ؟ PlayTime ولا غيره ؟
 - 
	^ كودي السابق شغال بس مدري ماشتغل عندك جرب ذا local Admin = { {"ملك الدرفت","KingDrift","20"}, {"كبار الشخصيات","V.I.P","30"}, {"بوليس","Police","45"}, {"مشرف","Moderator","60"}, {"مراقب","SuperModerator","90"}, {"ادمن","Admin","130"}, {"هيد ادمن","Head.Admin","160"}, {"بيج ادمن","Big.Admin","200"}, {"كنق ادمن","King.Admin","260"}, {"بروفيشينال ادمن","Professional.Admin","300"}, {"قائد الادمن","Leader.Admin","350"}, {"فيب ادمن","V.I.P.Admin","400"}, {"برو ادمن","Pro.Admin","450"}, {"ادمن خاص","Special.Admin","500"}, {"برنس السيرفر","Prince.of.Server","550"}, {"ادمن السيرفر","Admin.Server","600"}, {"جينيرال ادمن","Admin.General","700"}, {"ادمن اوفيشال","Admin-Official","1000"}, {"ادمن محترفين","Admin-Mo7TrFean","1200"}, {"مساعد السيرفر","AsSiStAnT.SeRvEr","1350"} } function centerWindow(center_window,xx,yy) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/xx,(screenH-windowH)/yy guiSetPosition(center_window,x,y,false) end GUIEditor = { gridlist = {}, staticimage = {}, button = {}, window = {} } local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 414) / 2, (screenH - 361) / 2, 414, 361, "لــــــوحـــة شـــرآء آلرتــــــــب", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF32CBC6") guiSetVisible(GUIEditor.window[1] ,false) GUIEditor.staticimage[1] = guiCreateStaticImage(9, 20, 395, 331, "logo.png", false, GUIEditor.window[1]) guiSetAlpha(GUIEditor.staticimage[1], 0.92) GUIEditor.gridlist[1] = guiCreateGridList(3, 24, 387, 257, false, GUIEditor.staticimage[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "الرتـب", 0.6) guiGridListAddColumn(GUIEditor.gridlist[1], "Group", 0.4) guiGridListAddColumn(GUIEditor.gridlist[1], "آلسآعآت", 0.2) GUIEditor.button[1] = guiCreateButton(130, 291, 116, 33, "شــرآء آلرتـــبــه", false, GUIEditor.staticimage[1]) local font0_seguisym = guiCreateFont("seguisym.ttf", 10) guiSetFont(GUIEditor.button[1], font0_seguisym) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF32CBC6") GUIEditor.button[2] = guiCreateButton(365, 300, 30, 31, "X", false, GUIEditor.staticimage[1]) guiSetFont(GUIEditor.button[2], font0_seguisym) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF32CBC6") addEventHandler("onClientGUIClick",GUIEditor.button[2], function() guiSetVisible(GUIEditor.window[1] ,false) showCursor(false) end ,false) for k,v in ipairs ( Admin ) do row = guiGridListAddRow(GUIEditor.gridlist[1]); guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v[1],false,false); guiGridListSetItemText(GUIEditor.gridlist[1],row,2,v[2],false,false); guiGridListSetItemText(GUIEditor.gridlist[1],row,3,v[3],false,false); guiGridListSetItemColor(GUIEditor.gridlist[1],row,3,254,244,0); guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,0,0); guiGridListSetItemColor(GUIEditor.gridlist[1],row,2,255,0,0); guiSetFont(GUIEditor.gridlist[1],"default-bold-small"); end xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local Group = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,2 )); local Price = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,3 )); local Name = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,1 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price,Name); else outputChatBox("* الرجاء أختيار رتبة",255,0,0,true); end end addCommandHandler('رتب',function() guiSetVisible( GUIEditor.window[1] , true ) showCursor( true ) end )
 
