-
Posts
1,304 -
Joined
-
Last visited
-
Days Won
5
Everything posted by Ahmed Ly
-
https://forum.multitheftauto.com/forum/137-دروس-في-البرمجة/
-
جرب -----الكلنت local Marker1 = createMarker ( 1615.99597, -1506.97876, 13.20746 , "cylinder" , 1.5 , 255 , 0 , 255 , 0 ) Blip = createBlipAttachedTo ( Marker1 , 38 ) outputChatBox ( " اذهب الى العلامة للاكمال المهمة " ) GUIEditor = { tab = {}, button = {}, window = {}, memo = {}, label = {}, tabpanel = {}, } GUIEditor.window[1] = guiCreateWindow(391, 352, 500, 240, "Delivery/ /Drugs", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.85) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFF0000") GUIEditor.button[1] = guiCreateButton(39, 38, 116, 38, "Drug transfer 1", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[3] = guiCreateButton(40, 110, 116, 38, "Drug transfer 2", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "default-bold-small") guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFFFFFF") GUIEditor.label[1] = guiCreateLabel(174, 44, 294, 29, "Transport drugs to the LV city/for 7,000k", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.label[3] = guiCreateLabel(175, 113, 294, 29, "Transport drugs to the SF city/for 15,000k", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") GUIEditor.button[6] = guiCreateButton(40, 175, 116, 38, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[6], "default-bold-small") guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFFFFFF") GUIEditor.tabpanel[2] = guiCreateTabPanel(241, 152, 250, 79, false, GUIEditor.window[1]) GUIEditor.tab[2] = guiCreateTab("explained", GUIEditor.tabpanel[2]) GUIEditor.memo[2] = guiCreateMemo(9, 6, 239, 46, "criminal can take Drugs car to any city for money .....Enjoy", false, GUIEditor.tab[2]) guiMemoSetReadOnly(GUIEditor.memo[2], true) guiSetVisible (GUIEditor.window[1], false) addEventHandler("onClientMarkerHit",Marker1, --عند لمس الماركر المحدد function()--وظيفة if ( getPlayerTeam ( localPlayer ) ~= getTeamFromName ( 'Criminal' ) ) then return end guiSetVisible(GUIEditor.window[1],true)--تفتح اللوحة showCursor(true) --نظهر الماوس end --نهاية الوظيفة )--نهاية قوس الحدث ---------------------- addEventHandler("onClientGUIClick",root, --عند الضغط على زر function()--وظيفة if source == GUIEditor.button[1] then triggerServerEvent ("takecar",localPlayer) ------------------------------------------------- elseif source == GUIEditor.button[3] then triggerServerEvent ("takecar",localPlayer) ------------------------------------------------- elseif (source == GUIEditor.button[6]) then--ان كان الزر = زر الاغلاق guiSetVisible(GUIEditor.window[1],false)--اغلاق اللوحة showCursor(false)--اخفاء الماوس end--نهاية التحقق end--نهاية الوظيفة )--نهاية قوس الحدث -------------------------------- addEvent ("CreateMarker",true) addEventHandler ("CreateMarker",root, function () Marker = createMarker ( 1022.32654, 2376.93408, 9.82031 , "cylinder" , 3 , 255 , 0 , 0 , 180 ) Blip = createBlipAttachedTo ( Marker , 51 ) end ) addEventHandler ("onClientMarkerHit",Marker, function (hitplayer,_) if hitplayer == localPlayer and isPedInVehicle ( hitplayer ) then triggerServerEvent("GivePlayerMoney", hitplayer ) destroyElement ( Marker ) destroyElement ( Blip ) end end ) -------------------السرفر Car = {} addEvent("takecar",true) addEventHandler("takecar",root, function() Car[source] = createVehicle( 459 , 1604.86340, -1466.26294, 13.56293 ) warpPedIntoVehicle( source , Car[source] ) triggerClientEvent ( source , "CreateMarker" , source ) end ) addEvent ("GivePlayerMoney",true) addEventHandler ("GivePlayerMoney",root, function () givePlayerMoney ( source , 5000 ) outputChatBox (" لقد انهيت المهمة وحصلت على 5000 " , source ,0,255,0,true) destroyElement ( Car[source] ) Car[source] = nil end )
-
جرب addEvent("play2",true) addEventHandler("play2",root, function (m) if isElement(sound) then stopSound(sound) end sound = playSound(""..m..".mp3") end ) addEventHandler("onClientGUIClick",root, function () if source == btn1 then if isElement(sound) then setSoundVolume(sound,getSoundVolume(sound)+1) outputChatBox("قوة الصوت في اغنيه هيا"..getSoundVolume(sound).."",0,255,0,true) else outputChatBox("لا توجد اغنيه",0,255,true) end end end )
-
-- Client addEventHandler("onClientGUIClick",root, function () if source == btn then s = guiGetText(edit) if s ~= "" then triggerServerEvent("play",localPlayer,s) end end end ) -- Server addEvent("play",true) addEventHandler("play",root, function (s) m = s triggerClientEvent("play2",root,m) end ) -- Client addEvent("play2",true) addEventHandler("play2",root, function (m) if isElement(m) then stopSound(m) end sound = playSound(""..m..".mp3") end )
-
copy /paste
-
https://wiki.multitheftauto.com/wiki/AR/isElement
-
if s ~= "" then هدا انا متحقق بان ميمو مو فاضي
-
ليك انت بس كود هدا يشغل أغاني لكل الاعبين -- Client addEventHandler("onClientGUIClick",root, function () if source == btn then s = guiGetText(edit) if s ~= "" then triggerServerEvent("play",localPlayer,s) end end end ) -- Server addEvent("play",true) addEventHandler("play",root, function (s) m = s triggerClientEvent("play2",root,m) end ) -- Client addEvent("play2",true) addEventHandler("play2",root, function (m) playSound(""..m..".mp3") end )
-
addEventHandler("onClientGUIClick",root, function () if source == btn then s = guiGetText(edit) playSound(""..s..".mp3") end end )
-
"onClientGUIClick" guiGetText triggerServerEvent playSound
-
استخدام setVehicleColor
-
function TheInicio() exports.scoreboard:scoreboardAddColumn("Occupation",true) outputDebugString ( "Police Job !!" ) end addEventHandler("onResourceStart", resourceRoot, TheInicio) addEventHandler("onResourceStart", resourceRoot, TheInicio) TeamPolice = createTeam ( "Police", 25, 112, 255 ) Police = createBlip (1553.64844, -1675.55835, 16.19531 ,30,2 ) setBlipVisibleDistance(Police, 250) Police = createBlip (2278.50317, 2459.65356, 10.82031,30,2 ) setBlipVisibleDistance(Police , 250) Police = createBlip (-217.98021, 985.25208, 19.55117,61,2 ) setBlipVisibleDistance(Police , 250) Police = createBlip (-1615.43188, 683.04700, 7.18750,30,2 ) setBlipVisibleDistance(Police , 250) function takeTheCrimJob() local TeamCrim = getTeamFromName ("Police") setElementModel (source,283) setPlayerTeam (source, TeamCrim ) setElementData (source, "Occupation", "Police" ) setPlayerNametagColor (source, 25, 112, 255 ) end addEvent ("Police", true ) addEventHandler ("Police",root,takeTheCrimJob)
-
function consoletm() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then setPlayerTeam(source, conteam) bb = createBlipAttachedTo (source, 53 ) setTimer(setBlipColor,100,0,bb,math.random ( 255 ), math.random ( 255 ), math.random ( 255 ),255) end end addEventHandler ( "onPlayerWasted", getRootElement(),consoletm) addEventHandler("onPlayerJoin",getRootElement(),consoletm) addEventHandler("onPlayerSpawn",getRootElement(),consoletm)
-
--#Client GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() wind = guiCreateWindow((screenW - 377) / 2, (screenH - 306) / 2, 377, 306, "اسم العربي ", false) guiWindowSetSizable(wind, false) guiSetProperty(wind, "CaptionColour", "FFFF0000") guiSetVisible(wind,false) edit = guiCreateEdit(28, 69, 324, 32, "", false, wind) give = guiCreateButton(109, 139, 148, 47, "تطبيق اسم العربي", false, wind) guiSetProperty(give, "NormalTextColour", "FFAAAAAA") GUIEditor.label[1] = guiCreateLabel(3, 194, 374, 15, "_______________________________________________________________________________________________________", false, wind) guiSetProperty(GUIEditor.label[1], "NormalTextColour", "FFAAAAAA") ex = guiCreateButton(106, 244, 151, 45, "اغلاق", false, wind) guiSetProperty(ex, "NormalTextColour", "FFAAAAAA") end ) bindKey("F7", "down" , function () guiSetVisible ( wind , not guiGetVisible ( wind ) ) showCursor ( not isCursorShowing ( ) ) end ) addEventHandler ( "onClientGUIClick" , root , function ( ) --نجرب if ( source == give ) then local Num = guiGetText ( edit ) if ( Num ~= "" ) then triggerServerEvent ( "GiveMoney" , localPlayer , Num ) end end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == ex ) then guiSetVisible(wind,false) showCursor(false) end end) --#Server addEvent ( "GiveMoney" , true ) addEventHandler ( "GiveMoney" , root , function ( Num ) setPlayerNametagText ( source,Num ) outputChatBox ( "#FF0000اسمك الأن #00FF00عربي "..Num.."",source, 255, 255, 255, true ) end )
-
---مود لوحة زوائد ---كلنت مود ارسال فلوس GUIEditor = { label = { } , window = { } , gridlist = { } , edit = { } , button = { } }; GUIEditor_Image = {} Key = "f2" GUIEditor.window[1] = guiCreateWindow(817,135,392,412,"",false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) zzz = guiCreateStaticImage(10,11,373,392,"images/LK.png",false,GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(3,49,145,342,false,zzz) guiGridListAddColumn(GUIEditor.gridlist[1],"Player",9,0) GUIEditor.button[1] = guiCreateButton(250,128,119,43,"ارسال",false,zzz) GUIEditor.edit[1] = guiCreateEdit(181,203,192,37,"",false,zzz) GUIEditor.label[1] = guiCreateLabel(150,298,222,92,"BY LIBYA_FREE",false,zzz) guiLabelSetColor(GUIEditor.label[1],255,0,0) GUIEditor_Image[1] = guiCreateStaticImage(215,2,93,70,"images/logo.png",false,zzz) local screenW, screenH = guiGetScreenSize() Controll = guiCreateWindow((screenW - 767) / 2, (screenH - 507) / 2, 767, 507, "لوحة زوائد زروط ليبيا", false) Controll = guiCreateStaticImage(9,0,749,498,"images/rules.png",false,Control) GUIEditor_Image[2] = guiCreateStaticImage(224,4,325,275,"images/tarkep.png",false,Controll) button2 = guiCreateButton(3,212,233,63,"لوحة فتح ابواب السيارة",false,Controll) guiSetProperty(button2, "NormalTextColour", "FFE9F807") button8 = guiCreateButton(2,387,233,63,"لوحة حفط الملابس",false,Controll) guiSetProperty(button8, "NormalTextColour", "FFFF0000") button10 = guiCreateButton(4,295,233,63,"لوحة توب الدرفت",false,Controll) guiSetProperty(button10, "NormalTextColour", "FF01FAB7") button3 = guiCreateButton(536,295,233,63,"لوحة ارسال فلوس",false,Controll) guiSetProperty(button3, "NormalTextColour", "FFEA5B0D") button4 = guiCreateButton(534,385,233,63,"لوحة اختيار ليزر",false,Controll) guiSetProperty(button4, "NormalTextColour", "FF5AF505") button13 = guiCreateButton(533,218,233,63,"اغاني",false,Controll) guiSetProperty(button13, "NormalTextColour", "FFD7259A") guiSetVisible(Controll,false) bindKey("F5","down", function () guiSetVisible(Controll,not guiGetVisible(Controll)) showCursor(guiGetVisible(Controll)) end) addEventHandler ("onClientGUIClick", root, function() if (source == button8) then guiSetVisible(Control, false) showCursor(false) guiSetInputEnabled(false) end end ) addEventHandler ("onClientGUIClick", root, function() if (source == button4) then guiSetVisible(Controll, false) guiSetVisible(laser,true) elseif (source == button16) then -- elseif (source == button13) then guiSetVisible(Controll, false) guiSetVisible(window,true) elseif (source == button2) then guiSetVisible(Controll, false) guiSetVisible(Car,true) elseif (source == button8) then guiSetVisible(Controll, false) guiSetVisible(Cj,true) elseif (source == button3) then guiSetVisible(Controll, false) guiSetVisible(GUIEditor.window[1],true) end end ) addEventHandler("onClientGUIClick",root, function () if source == button10 then if ( guiGetVisible(HD.wnd) == false ) then guiSetVisible(Control,false) showCursor(false) guiSetInputEnabled(false) end guiSetVisible(HD.wnd,not guiGetVisible(HD.wnd)) showCursor(guiGetVisible(v)) guiSetInputEnabled(guiGetVisible(HD.wnd)) end end ) function RefreshGridlist ( aElement , Col ) if ( getElementType ( aElement ) == "gui-gridlist" ) then guiGridListClear ( aElement ) Col = Col or 1 for i,v in ipairs ( getElementsByType("player") ) do local aRow = guiGridListAddRow ( aElement ) guiGridListSetItemText ( aElement , aRow , Col , getPlayerName ( v ) , false , false ) end end end bindKey(key,"down", function ( ) guiSetVisible ( GUIEditor.window [ 1 ] , not guiGetVisible ( GUIEditor.window [ 1 ] ) ) showCursor ( guiGetVisible ( GUIEditor.window [ 1 ] ) ) guiSetInputEnabled ( guiGetVisible ( GUIEditor.window [ 1 ] ) ) RefreshGridlist ( GUIEditor.gridlist [ 1 ] ) end ); function Update ( ) RefreshGridlist ( GUIEditor.gridlist [ 1 ] ) end addEventHandler ("onClientPlayerJoin",root,Update) addEventHandler ("onClientPlayerChangeNick",root,Update) addEventHandler ("onClientPlayerQuit",root,Update) --------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == GUIEditor.button[1] ) then local InfoSelected = { guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) }; if ( InfoSelected [ 1 ] ~= -1 and guiGetText ( GUIEditor.edit[1] ) ~= "" ) then triggerServerEvent("SendMoney",getLocalPlayer(),guiGridListGetItemText(GUIEditor.gridlist[1],InfoSelected[1],InfoSelected[2]),guiGetText(GUIEditor.edit[1])) else outputChatBox("رجاء اختار اسم لاعب او مبلغ",255,150,0,true) end end end ) --ملف سيرفرامتع ارسال فلوس addEvent("SendMoney",true) addEventHandler("SendMoney",root, function ( aPlayer , aPrice ) if ( getPlayerFromName ( aPlayer ) and tonumber ( aPrice ) ) then if ( getPlayerFromName ( aPlayer ) == source ) then return outputChatBox("* لاتستطيع ارسال المال لنفسك!",source,255,150,0,true) end if ( getPlayerMoney ( source ) >= tonumber ( aPrice ) ) then givePlayerMoney ( getPlayerFromName ( aPlayer ) , tonumber ( aPrice ) ) takePlayerMoney ( source , tonumber ( aPrice ) ) else outputChatBox("* You Don't Have "..aPrice.."",source,255,0,0,true) end end end )
-
---مود لوحة زوائد ---كلنت مود ارسال فلوس GUIEditor = { label = { } , window = { } , gridlist = { } , edit = { } , button = { } , Key = "f2" }; GUIEditor_Image = {} GUIEditor.window[1] = guiCreateWindow(817,135,392,412,"",false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) zzz = guiCreateStaticImage(10,11,373,392,"images/LK.png",false,GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(3,49,145,342,false,zzz) guiGridListAddColumn(GUIEditor.gridlist[1],"Player",9,0) GUIEditor.button[1] = guiCreateButton(250,128,119,43,"ارسال",false,zzz) GUIEditor.edit[1] = guiCreateEdit(181,203,192,37,"",false,zzz) GUIEditor.label[1] = guiCreateLabel(150,298,222,92,"BY LIBYA_FREE",false,zzz) guiLabelSetColor(GUIEditor.label[1],255,0,0) GUIEditor_Image[1] = guiCreateStaticImage(215,2,93,70,"images/logo.png",false,zzz) local screenW, screenH = guiGetScreenSize() Control = guiCreateWindow((screenW - 767) / 2, (screenH - 507) / 2, 767, 507, "لوحة زوائد زروط ليبيا", false) Controll = guiCreateStaticImage(9,0,749,498,"images/rules.png",false,Control) GUIEditor_Image[2] = guiCreateStaticImage(224,4,325,275,"images/tarkep.png",false,Controll) button2 = guiCreateButton(3,212,233,63,"لوحة فتح ابواب السيارة",false,Controll) guiSetProperty(button2, "NormalTextColour", "FFE9F807") button8 = guiCreateButton(2,387,233,63,"لوحة حفط الملابس",false,Controll) guiSetProperty(button8, "NormalTextColour", "FFFF0000") button10 = guiCreateButton(4,295,233,63,"لوحة توب الدرفت",false,Controll) guiSetProperty(button10, "NormalTextColour", "FF01FAB7") button3 = guiCreateButton(536,295,233,63,"لوحة ارسال فلوس",false,Controll) guiSetProperty(button3, "NormalTextColour", "FFEA5B0D") button4 = guiCreateButton(534,385,233,63,"لوحة اختيار ليزر",false,Controll) guiSetProperty(button4, "NormalTextColour", "FF5AF505") button13 = guiCreateButton(533,218,233,63,"اغاني",false,Controll) guiSetProperty(button13, "NormalTextColour", "FFD7259A") guiSetVisible(Controll,false) bindKey("F5","down", function () guiSetVisible(Control,not guiGetVisible(Control)) showCursor(guiGetVisible(Control)) end) addEventHandler ("onClientGUIClick", root, function() if (source == button8) then guiSetVisible(Control, false) showCursor(false) guiSetInputEnabled(false) end end ) addEventHandler ("onClientGUIClick", root, function() if (source == button4) then guiSetVisible(Control, false) guiSetVisible(laser,true) elseif (source == button16) then -- elseif (source == button13) then guiSetVisible(Control, false) guiSetVisible(window,true) elseif (source == button2) then guiSetVisible(Control, false) guiSetVisible(Car,true) elseif (source == button8) then guiSetVisible(Control, false) guiSetVisible(Cj,true) elseif (source == button3) then guiSetVisible(Control, false) guiSetVisible(GUIEditor.window[1],true) end end ) addEventHandler("onClientGUIClick",root, function () if source == button10 then if ( guiGetVisible(HD.wnd) == false ) then guiSetVisible(Control,false) showCursor(false) guiSetInputEnabled(false) end guiSetVisible(HD.wnd,not guiGetVisible(HD.wnd)) showCursor(guiGetVisible(v)) guiSetInputEnabled(guiGetVisible(HD.wnd)) end end ) function RefreshGridlist ( aElement , Col ) if ( getElementType ( aElement ) == "gui-gridlist" ) then guiGridListClear ( aElement ) Col = Col or 1 for i,v in ipairs ( getElementsByType("player") ) do local aRow = guiGridListAddRow ( aElement ) guiGridListSetItemText ( aElement , aRow , Col , getPlayerName ( v ) , false , false ) end end end bindKey(GUIEditor["Key"],"down", function ( ) guiSetVisible ( GUIEditor.window [ 1 ] , not guiGetVisible ( GUIEditor.window [ 1 ] ) ) showCursor ( guiGetVisible ( GUIEditor.window [ 1 ] ) ) guiSetInputEnabled ( guiGetVisible ( GUIEditor.window [ 1 ] ) ) RefreshGridlist ( GUIEditor.gridlist [ 1 ] ) end ); function Update ( ) RefreshGridlist ( GUIEditor.gridlist [ 1 ] ) end addEventHandler ("onClientPlayerJoin",root,Update) addEventHandler ("onClientPlayerChangeNick",root,Update) addEventHandler ("onClientPlayerQuit",root,Update) --------------------- addEventHandler("onClientGUIClick",resourceRoot, function ( ) if ( source == GUIEditor.button[1] ) then local InfoSelected = { guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) }; if ( InfoSelected [ 1 ] ~= -1 and guiGetText ( GUIEditor.edit[1] ) ~= "" ) then triggerServerEvent("SendMoney",getLocalPlayer(),guiGridListGetItemText(GUIEditor.gridlist[1],InfoSelected[1],InfoSelected[2]),guiGetText(GUIEditor.edit[1])) else outputChatBox("رجاء اختار اسم لاعب او مبلغ",255,150,0,true) end end end ) --ملف سيرفرامتع ارسال فلوس addEvent("SendMoney",true) addEventHandler("SendMoney",root, function ( aPlayer , aPrice ) if ( getPlayerFromName ( aPlayer ) and tonumber ( aPrice ) ) then if ( getPlayerFromName ( aPlayer ) == source ) then return outputChatBox("* لاتستطيع ارسال المال لنفسك!",source,255,150,0,true) end if ( getPlayerMoney ( source ) >= tonumber ( aPrice ) ) then givePlayerMoney ( getPlayerFromName ( aPlayer ) , tonumber ( aPrice ) ) takePlayerMoney ( source , tonumber ( aPrice ) ) else outputChatBox("* You Don't Have "..aPrice.."",source,255,0,0,true) end end end )
-
Good job
-
https://forum.multitheftauto.com/forum/135-المساهمات/ انشر موداتك في قسم المساهمات
-
-- جرب و اتاكد من الميتا!! -- كلنت addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then local rankstake = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if rankstake == 1 then triggerServerEvent("lv1", localPlayer) end end end ) --Server addEvent("lv1",true) addEventHandler("lv1",root, function() if getElementData(source,'Level') >= 15 then acc1 = getPlayerAccount(source) if not isGuestAccount(acc1) then acc2 = getAccountName(acc1) if not isObjectInACLGroup ("user."..acc2,aclGetGroup ("Level1")) then aclGroupAddObject (aclGetGroup("Level1"), "user."..acc2) outputChatBox("تم اخذ رتبة جديدة",source,255,255,255,true) playSoundFrontEnd(source,20) else outputChatBox("لديك هاذي رتبة ",source,255,255,255,true) end else outputChatBox("يجب عليك تسجيل",source,0,255,0,true) end else outputChatBox("ليس لديك ساعات",source,0,255,0,true) end end )
