Jump to content

Mr.R

Members
  • Posts

    775
  • Joined

  • Last visited

Posts posted by Mr.R

  1. تفضل هذا الكود , مسويه من زمان ومجرب وشغال 100% ملاحظه : سطر 10 بملف سيرفر غير رقم 411 بايدي السيارهـ الي تبيها

    #Client

    addEventHandler ( "onClientGUIClick", resourceRoot,  
    function (    ) 
        if ( source == اسم الزر ) then 
            triggerServerEvent ( "GiveVehicle", localPlayer ) 
        end 
    end ) 
    

    #Server

    local Vehicle = {    }; 
      
    addEvent ( "GiveVehicle", true ) 
    addEventHandler ( "GiveVehicle", root,  
    function (    ) 
        if ( Vehicle[source] ) and ( isElement ( Vehicle[source] ) ) then 
            destroyElement ( Vehicle[source] ) 
        end 
        local x, y, z = getElementPosition ( source ) 
        Vehicle[source] = createVehicle ( 411, x, y, z ) 
        warpPedIntoVehicle ( source, Vehicle[source] ) 
        if ( getPlayerMoney ( source ) >= 2000 ) then 
        takePlayerMoney ( source, 2000 ) 
        outputChatBox ( "* تم شراء السيارهـ بنجاح", source, 255, 255, 255, true ) 
            else 
        outputChatBox ( "* لا تملك المال الكافي لـ شراء السيارهـ", source, 255, 255, 255, true ) 
        end 
    end ) 
    
  2. ^ هو محدد جميع الماركرات اللي بالسكربت, يعني سواء كانت ماركر اواكثر ..

    والله ماكنت ادري , انا استغربت ماشفته حدد اي ماركر + مشكور عالمعلومه

    getElementType وما يحتاج تستخدم

    "onClientMarkerHit" :

    hitPlayer: The player that hit the marker.

    "onMarkerHit" :

    hitElement: The element that hit the marker

    هذي شفتها بالويكي بس عادي حتى لو حطيتها ماتضر , زياده على الفاضي ض1

    لاكن شلناها لعيونك :$ + وصلحت الكود

  3. local marker = createMarker ( x, y, z, "cylinder", size, r, g, b, alpha ) 
      
    addEventHandler ( "onClientMarkerHit", resourceRoot,  
    function ( player ) 
          if ( source == marker ) and ( player == localPlayer ) then 
                guiSetVisible ( اسم اللوحه, true ) 
            showCursor ( true ) 
        end 
    end ) 
    
  4. يعطيك العافيه بس الاكواد ذي ويش

    ما انصحك

    هههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه

    هههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه

    ههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههههه

  5. انا ابيه

    مثلا احدد على اسمه

    وادق على زر ريموف

    ويقوم يموت !

    يخرج من الماب

    ازاله

    بالعربي

    انا فاهم قصدك

    زر اسمه ريموف اذا ضغطه يموت , كان موجود على ايام البيس مود

    عموماً تفضل

    #Client

    addEventHandler ( "onClientGUIClick", resourceRoot, 
    function (    ) 
        if ( source == اسم الزر ) then 
            triggerServerEvent ( "Kill", localPlayer ) 
        end 
    end ) 
    

    #Server

    addEvent ( "Kill", true ) 
    addEventHandler ( "Kill", root, 
    function ( player ) 
        killPed ( player ) 
        outputChatBox ( "* تمت ازالتك", player, 255, 255, 255, true ) 
    end ) 
    
  6. شكرا بس ابي شخصيات يعني افتح اللوحة اجد في جريد لست مجموعة من الشخصبيات

    وشكرا اللي ساعدوني

    تفضل هذا طلبك كامل , لاتنسخه وتمشي افهم كيف صارت الاكواد

    واذا منت فاهم شيء تفضل , اسأل عنه .. :wink:

    #Client

    local Skins = {  
        { "ARMY", 287 }, 
        { "SWAT", 285 }, 
        -- { "Skin Name", iD }, -- ضيف كل السكنات الي تبيها لو مليون سكن 
    } 
      
    addEventHandler ( "onClientResourceStart", resourceRoot, function (    ) 
        Window1 = guiCreateWindow ( 247, 143, 639, 510, "Skin Window", false ) 
        guiWindowSetSizable ( Window1, false ) 
        guiSetVisible ( Window1, false ) 
        GridList = guiCreateGridList ( 9, 21, 154, 452, false, Window1 ) 
        guiGridListAddColumn ( GridList, "Skins...", 0.9 ) 
        for _,v in ipairs ( Skins ) do 
            local Row = guiGridListAddRow ( GridList ) 
            guiGridListSetItemText ( GridList, Row, 1, tostring ( v[1] ), false, false ) 
            guiGridListSetItemData ( GridList, Row, 1, tonumber ( v[2] ) ) 
        end 
        Button1 = guiCreateButton ( 191, 350, 200, 49, "Change Skin", false, Window1 ) 
    end ) 
      
    bindKey ( "F5", "down", function (    ) 
          guiSetVisible ( Window1, not guiGetVisible ( Window1 ) ) 
          showCursor ( guiGetVisible ( Window1 ) ) 
    end ) 
      
    addEventHandler ( "onClientGUIClick", resourceRoot, function (    ) 
    if ( source == Button1 ) then 
        if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then 
            local SkinName = guiGridListGetItemText ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) 
            local SkiniD = guiGridListGetItemData( GridList, guiGridListGetSelectedItem( GridList ), 1 ) 
                if ( SkinName ~= '' and SkiniD ~= '' ) then  
                    triggerServerEvent ( "Skin", localPlayer, SkiniD ) 
                end 
            else 
                outputChatBox ( "* Please Select Skin", 0, 255, 0, true ) 
            end 
        end 
    end ) 
    

    #Server

    addEvent ( "Skin", true ) 
    addEventHandler ( "Skin", root, function ( SkiniD ) 
        setElementModel ( source, tonumber ( SkiniD ) ) 
        outputChatBox ( "* Changed Skin", source, 255, 0, 0, true ) 
    end ) 
    
  7. سوال ؟

    كل ما اطلب كود الكل يعصب و يقول حاول

    وش فايدة قسم البرمجة

    فايدته انك تتعلم منه , وتسال وتستفسر منه لين ترتفع خبرتك

    ماتجي تطلب جاهز وتسوي مودات نسخ لصق وتروح , بكذا عمرك كله ماراح تتعلم حتى لو 5% واساسيات البرمجه بعد ء

    الله يهديك بس لازم تتعلم مو كل مره تطلب جاهز

  8. م صارت تفتح ..

    bindKey ( Command, "down", function (   ) 
          guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) 
          showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) 
    end ) 
    

    اعدادات

    Command = "F10" -- زر فتح لوحه الإشتراك 
    

    تراني مافهمت قصدك بالضبط , ياليت تقوله

    حطها كذا بجانب كلنت

    Command = "F10" 
      
    bindKey ( Command, "down", function (   ) 
          guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) 
          showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) 
    end ) 
    
  9. طيب , لو انا ينفع اعمله كدا
      
    addCommandHandler ( Command, function (    ) 
        guiSetVisible ( GUIEditor.window[2], not guiGetVisible ( GUIEditor.window[2]) ) 
        showCursor ( guiGetVisible ( GUIEditor.window[2] ) ) 
    end ) 
    

    الاعدادت

    Command = "F10" 
    

    بالطريقه ذي ينفع ايه

  10. تفضل , جرب

    wnd1 , wnd2 ولا تحط لوكال على

    wnd1 = createOrderWindow_BTN = "F10" 
    wnd2 = manageRent = "manageRent" 
      
    bindKey ( createOrderWindow_BTN, "down", function (    ) 
        guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) 
        showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) 
    end ) 
      
    addCommandHandler ( manageRent, function (    ) 
        guiSetVisible ( GUIEditor.window[2], not guiGetVisible ( GUIEditor.window[2]) ) 
        showCursor ( guiGetVisible ( GUIEditor.window[2] ) ) 
    end ) 
    

    الاعدادات

    Settings = { 
        wnd1 = "F10", 
        wnd2 = "manageRent" 
    } 
    

    اذا قصدك يغير الزر او الكوماند من لوحة الادمنيه

    ضيف هذا لـ الميتا

        "*wnd1" value = "F10" desc = "Key to Open Window."/> 
        "*wnd2" value = "manageRent" desc = "Command to Open Window."/>                
    
    
  11. خذ ذا مثال ع طلبك

    اي شيء منت فاهمه , تفضل اسأل

    thePhoto = guiCreateStaticImage ( ... ) 
      
    local PlayersAndPhotos = { 
        { "Mr.R", "1.png" }, 
        { "Le3bA", "2.png" }, 
        { "Adham", "3.png" } 
    } 
      
    addEventHandler ( "onClientGUIClick", resourceRoot, 
    function (    ) 
        if ( source == GridList ) then 
            if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then 
            local GetSelected = guiGridListGetItemText ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) 
                if ( GetSelected ~= '' ) then 
            guiStaticImageLoadImage ( thePhoto, " ".. GetSelected .." .png" ) 
        end 
      else 
            guiStaticImageLoadImage ( thePhoto, "0.png" ) 
        end 
      end 
    end ) 
    
  12. الوحه القلتلي عليها اهي
      
    GUIEditor = { 
        gridlist = {}, 
        window = {}, 
        button = {} 
    } 
    addEventHandler("onClientResourceStart", resourceRoot, 
        function() 
            GUIEditor.window[1] = guiCreateWindow(148, 142, 444, 340, "Players", false) 
            guiWindowSetSizable(GUIEditor.window[1], false) 
             guiSetVisible ( GUIEditor.window[1],false )  
            GUIEditor.button[1] = guiCreateButton(9, 39, 170, 47, "تفعيل", false, GUIEditor.window[1]) 
            GUIEditor.button[2] = guiCreateButton(9, 154, 170, 47, "الغأ التفعيل", false, GUIEditor.window[1]) 
            GUIEditor.gridlist[1] = guiCreateGridList(227, 26, 207, 304, false, GUIEditor.window[1]) 
            guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9)     
             
          wnd = guiCreateWindow(219, 134, 391, 395, "F10", false) 
            guiWindowSetSizable(wnd, false) 
              guiSetVisible ( wnd,false )  
            GUIEditor.button[1] = guiCreateButton(101, 150, 223, 48, "#", false, wnd)    
             
        end 
    ) 
      
      
      
      
      
      
    function update () 
    guiGridListClear(GUIEditor.gridlist[1]) 
    for i,v in ipairs (getElementsByType("player")) do 
    local rp = guiGridListAddRow (GUIEditor.gridlist[1]) 
    guiGridListSetItemText (GUIEditor.gridlist[1],rp,1,getPlayerName(v):gsub("#%x%x%x%x%x%x", ""),false,false) 
    end 
    end 
    addEventHandler ("onClientResourceStart",resourceRoot,update) 
    addEventHandler ("onClientPlayerJoin",root,update) 
    addEventHandler ("onClientPlayerChangeNick",root,update) 
    addEventHandler ("onClientPlayerQuit",root,update) 
      
      
    function Strong ( )   
    guiSetVisible ( GUIEditor.window[1],true )  
    showCursor ( true ) -- اظهار الماوس  
    end  
    addCommandHandler ( "Teams",Strong )  
    

    الوحه البيها تتفعل

    اسمها

    wnd

    الله يهديك , ماقلت لك اطرح اكواد اللوحه , اطرح محاولتك عن الشيء الي تبي تسويه , وآبشر

  13. والله مدري

    ولاكن جرب كذا , حسب الي فهمته من الويكي انه يقول تحقق من رصاص السلاح

    addEventHandler ( "onClientMarkerHit", root,  
    function ( hitting ) 
        if ( source == woodMark ) and ( hitting == localPlayer ) then 
            if ( getElementData ( hitting, "Occupation" ) == "Wood-Jop" ) and not ( isPedInVehicle ( hitting ) )then 
                if ( getPedTotalAmmo ( hitting ) == nil ) then return end 
                    if ( getPedWeapon ( hitting ) and ( getPedWeaponSlot ( hitting ) ) == 9  ) then 
                        bindKey ( "N","down", startJob2 ) 
                    end 
                end 
            end 
        end  
    ) 
    
  14. local marker = createMarker ( 3050.78467, -1484.73096, 16.32500, "arrow", 2, 255, 255, 0 ) 
    createBlipAttachedTo ( marker, 53 ) 
      
    addEventHandler ( "onMarkerHit", marker, function ( player ) 
        if ( getElementType ( player ) == "player" ) then 
            if ( getElementDimension ( player ) == 0 ) then 
                setElementDimension ( player, 30 ) 
                    setElementPosition ( player, 3160.18994, -1703.16089, 1.31431 ) 
                end 
            end 
        end, false 
    ) 
    
  15. اتوقع الكود كذا < ماني متأكد

    ياليت تشوف دايماً قبل لا تفكر تسوي شيء , امثله الويكي لانها غالبا نفس طلبك

    addEventHandler ( "onClientResourceStart", resourceRoot, 
    function (    ) 
        if ( isTransferBoxActive (    ) == true ) then 
            fadeCamera ( false ) 
        else 
            fadeCamera ( true ) 
        end 
    end ) 
    
  16. تفضل الاكواد مجربه

    #Client

    GUIEditor = { window = {    } } 
      
    addEventHandler ( "onClientResourceStart", resourceRoot, 
    function (    ) 
        GUIEditor.window[1] = guiCreateWindow ( 171, 199, 476, 149, "Car", false ) 
        guiWindowSetSizable ( GUIEditor.window[1], false ) 
        guiSetVisible ( GUIEditor.window[1], false ) 
         
        Repair = guiCreateButton ( 40, 60, 162, 38, "Repair", false, GUIEditor.window[1] ) 
        guiSetProperty ( Repair, "NormalTextColour", "FFAAAAAA") 
        Nitro = guiCreateButton ( 257, 60, 162, 38, "Nitro", false, GUIEditor.window[1] ) 
        guiSetProperty ( Nitro, "NormalTextColour", "FFAAAAAA" )     
    end ) 
      
    bindKey ( "F5", "down", 
    function (    ) 
          guiSetVisible ( GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) 
          showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) 
    end ) 
      
    addEventHandler("onClientGUIClick",root, 
    function (    ) 
        if ( source == Repair ) then 
            triggerServerEvent ( "buyRpr", localPlayer ) 
        elseif ( source == Nitro ) then 
            triggerServerEvent ( "buyNitro", localPlayer ) 
        end 
    end ) 
    

    #Server

    addEvent ( "buyRpr", true) 
    addEventHandler ( "buyRpr", root, 
    function (    ) 
            if ( isPedInVehicle ( source ) ) then 
                if ( getPlayerMoney ( source ) >= 5000 ) then 
                        takePlayerMoney ( source, 5000 ) 
                    fixVehicle ( getPedOccupiedVehicle ( source ) ) 
                outputChatBox ( getPlayerName ( source ) .." Has bought [ Repair ]", root, 255, 255, 255, true ) 
            end 
        end 
    end ) 
      
    addEvent ( "buyNitro", true) 
    addEventHandler ( "buyNitro", root, 
    function (    ) 
            if ( isPedInVehicle ( source ) ) then 
                if ( getPlayerMoney ( source ) >= 5000 ) then 
                        takePlayerMoney ( source, 5000 ) 
                    addVehicleUpgrade ( getPedOccupiedVehicle ( source ), 1010 ) 
                outputChatBox ( getPlayerName ( source ) .." Has bought [ Nitro ]", root, 255, 255, 255, true ) 
            end 
        end 
    end ) 
    

    @Le3bA

    ناقصك اند , حطها سطر 24

    ماهي معرفه rootElement و

×
×
  • Create New...