Jump to content

استفسار


Recommended Posts

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

  
local sx, sy = guiGetScreenSize( ) 
  
local frje = true 
local nfrje = false 
local lplar = getLocalPlayer(  ) 
  
function isMouseInPosition ( x, y, width, height ) 
    if ( not isCursorShowing ( ) ) then 
        return false 
    end 
    local sx, sy = guiGetScreenSize ( ) 
    local cx, cy = getCursorPosition ( ) 
    local cx, cy = ( cx * sx ), ( cy * sy ) 
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then 
        return true 
    else 
        return false 
    end 
end 
  
function someT() 
  
    dxDrawRectangle(356, 184, 640, 382, tocolor(0, 0, 0, 160), false) 
    dxDrawRectangle(356, 183, 640, 32, tocolor(255, 137, 0, 255), false) 
    dxDrawRectangle(356, 534, 640, 32, tocolor(255, 137, 0, 255), false) 
    dxDrawRectangle(366, 225, 134, 111, tocolor(255, 137, 0, 255), false) 
    dxDrawRectangle(366, 225, 134, 111, tocolor(255, 137, 0, 255), false) 
    dxDrawRectangle(366, 346, 134, 25, tocolor(255, 137, 0, 255), false) 
    dxDrawRectangle(366, 378, 134, 111, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(366, 499, 134, 25, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(852, 225, 134, 111, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(852, 378, 134, 111, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(852, 499, 134, 25, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(852, 346, 134, 25, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(609, 225, 134, 111, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(609, 346, 134, 25, tocolor(255, 137, 0, 255), false)-- 
    dxDrawRectangle(609, 378, 134, 111, tocolor(255, 137, 0, 255), false) 
    dxDrawRectangle(609, 499, 134, 25, tocolor(255, 137, 0, 255), false) 
    dxDrawText("Carball Shop", 400, 184, 953, 213, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Faster Car", 376, 235, 490, 326, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Higher Jump", 619, 235, 733, 326, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("...", 862, 235, 976, 326, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Freeze Players", 376, 388, 490, 479, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("...", 619, 388, 733, 479, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("...", 862, 388, 976, 479, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Exit", 400, 534, 953, 563, tocolor(255, 255, 255, 255), 1.50, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Buy 1K", 371, 349, 490, 368, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Buy 1K", 619, 349, 738, 368, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Buy 1K", 862, 349, 981, 368, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Buy 1K", 376, 499, 490, 524, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Buy 1K", 619, 499, 733, 524, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) 
    dxDrawText("Buy 1K", 862, 499, 976, 524, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) 
  
  
    if ( isMouseInPosition (356, 534, 640, 32) ) then 
        dxDrawRectangle(356, 534, 640, 32, tocolor(0, 0, 0, 100), false) 
         
    elseif ( isMouseInPosition (366, 225, 134, 111) ) then 
         
        dxDrawRectangle(366, 225, 134, 111, tocolor(0, 0, 0, 100), false) 
    end 
    if ( isMouseInPosition (366, 225, 134, 111) ) then 
         
        dxDrawRectangle(366, 225, 134, 111, tocolor(0, 0, 0, 100), false) 
    elseif ( isMouseInPosition (366, 346, 134, 25) ) then 
          
        dxDrawRectangle(366, 346, 134, 25, tocolor(0, 0, 0, 100), false) 
    end 
    if ( isMouseInPosition (366, 378, 134, 111) ) then 
          
        dxDrawRectangle(366, 378, 134, 111, tocolor(0, 0, 0, 100), false) 
    elseif ( isMouseInPosition (366, 499, 134, 25) ) then 
         
        dxDrawRectangle(366, 499, 134, 25, tocolor(0, 0, 0, 100), false) 
    end 
    if ( isMouseInPosition (852, 225, 134, 111) ) then 
        
        dxDrawRectangle(852, 225, 134, 111, tocolor(0, 0, 0, 100), false) 
    elseif ( isMouseInPosition (852, 378, 134, 111) ) then 
         
        dxDrawRectangle(852, 378, 134, 111, tocolor(0, 0, 0, 100), false) 
    end 
    if ( isMouseInPosition (852, 499, 134, 25) ) then 
         
        dxDrawRectangle(852, 499, 134, 25, tocolor(0, 0, 0, 100), false) 
    elseif ( isMouseInPosition (852, 346, 134, 25) ) then 
        
        dxDrawRectangle(852, 346, 134, 25, tocolor(0, 0, 0, 100), false) 
    end 
    if ( isMouseInPosition (609, 225, 134, 111) ) then 
      
        dxDrawRectangle(609, 225, 134, 111, tocolor(0, 0, 0, 100), false) 
    elseif ( isMouseInPosition (609, 346, 134, 25) ) then 
       
        dxDrawRectangle(609, 346, 134, 25, tocolor(0, 0, 0, 100), false) 
    end 
    if ( isMouseInPosition (609, 378, 134, 111) ) then 
       
        dxDrawRectangle(609, 378, 134, 111, tocolor(0, 0, 0, 100), false) 
    elseif ( isMouseInPosition (609, 499, 134, 25) ) then 
        
        dxDrawRectangle(609, 499, 134, 25, tocolor(0, 0, 0, 100), false) 
    end 
  
  
    showCursor( frje ) 
  
end 
  
addEventHandler( 'onClientClick', root, function () 
    local monn = getPlayerMoney( lplar ) 
    if ( monn < 1000 ) then 
        removeEventHandler( "onClientClick", root, dadas) 
    end 
end) 
  
bindKey( "F6", "down", function ( ) 
    if ( removeEventHandler( "onClientRender", root, someT) ) then 
        removeEventHandler( "onClientRender", root, someT) 
        removeEventHandler( "onClientClick", root, funcZZ ) 
        showCursor( nfrje ) 
    else  
        addEventHandler( "onClientRender", root, someT) 
        addEventHandler( "onClientClick", root, funcZZ ) 
        showCursor( frje ) 
    end 
end) 
  
local msare = getPlayerMoney( lplar ) 
local syatro = getPedOccupiedVehicle( lplar ) 
  
function dadas( button , state ) 
    if ( button == "left" and state == "down" ) then 
        if ( isMouseInPosition( 366, 346, 134, 25 ) and syatro and msare > 1000 ) then 
            funcName(); 
            takePlayerMoney( 1000 )    
            outputChatBox( '#ff8900[sHOP] #ffffffbuy', 0, 255, 0, true ) 
        end 
        if ( not syatro ) then 
            removeEventHandler( "onClientClick", root, dadas) 
        end 
    end 
end 
addEventHandler( "onClientClick", root, dadas) 
  
function dadas( button , state ) 
    if ( button == "left" and state == "down" ) then 
        if ( isMouseInPosition( 366, 499, 134, 25 ) and syatro and msare > 1000 ) then 
            funcNamex(); 
            takePlayerMoney( 1000 )  
            outputChatBox( '#ff8900[sHOP] #ffffffbuy', 0, 255, 0, true ) 
        end 
        if ( not syatro ) then 
            removeEventHandler( "onClientClick", root, dadas) 
        end 
    end 
end 
addEventHandler( "onClientClick", root, dadas) 
  
function dadas( button , state ) 
    if ( button == "left" and state == "down" ) then 
        if ( isMouseInPosition( 609, 346, 134, 25 ) and syatro and msare > 1000 ) then 
            funcNames(); 
            takePlayerMoney( 1000 )  
            outputChatBox( '#ff8900[sHOP] #ffffffbuy', 0, 255, 0, true ) 
        end 
        if ( not syatro ) then 
            removeEventHandler( "onClientClick", root, dadas) 
        end 
    end 
end 
addEventHandler( "onClientClick", root, dadas) 
  
addEventHandler( "onClientClick", root, function ( button , state ) 
    if ( button == "left" and state == "down" ) then 
        if ( isMouseInPosition( 356, 534, 640, 32 ) ) then 
            removeEventHandler( 'onClientRender', root, someT ) 
            showCursor( nfrje ) 
        end 
    end 
end) 
  
function funcName() 
    function fsdf() 
        local sraax, sraay, sraaz = getElementVelocity ( syatro ) 
        setElementVelocity( syatro, sraax * 1.5, sraay * 1.5, sraaz * 1.5) 
    end 
    function fsss()     
        unbindKey( 'mouse1', 'down', fsdf ) 
    end 
setTimer ( fsss, 10000, 1) 
bindKey( 'mouse1', 'down', fsdf) 
end 
  
  
function funcNames() 
    function funcNamfes() 
        x,y,z = getElementVelocity( syatro ) 
        setElementVelocity(syatro, x, y, z + 0.30) 
    if ( not isVehicleOnGround( syatro ) ) then 
        unbindKey( 'lshift', 'down', funcNames ) 
    else 
        bindKey( 'lshift', 'down', funcNames ) 
    end 
    end 
    bindKey( 'lshift', 'down', funcNamfes) 
end 
  
  
function funcNamex() 
    local kljfsd = getElementsByType( 'vehicle' ) 
    if ( kljfsd ) then 
        for k, vehicle in ipairs (kljfsd) do 
            setElementFrozen( vehicle, frje ) 
            setTimer( function()  
                setElementFrozen( vehicle, nfrje ) 
            end, 5000, 1, vehicle) 
            if ( isElementFrozen( syatro ) ) then 
                setElementFrozen( syatro, nfrje ) 
            end 
        end 
    end 
end 
  
function funcZZ( button , state ) 
    if ( button == "left" and state == "down" ) then 
        if ( isMouseInPosition( 852, 346, 134, 25 )  ) then    
            outputChatBox( '#ff8900[sHOP] #ffffffbuy', 255, 255, 255, true ) 
        elseif ( isMouseInPosition( 609, 499, 134, 25 )  ) then 
            outputChatBox( '#ff8900[sHOP] #ffffffbuy', 255, 255, 255, true ) 
        elseif ( isMouseInPosition( 852, 499, 134, 25 )  ) then 
            outputChatBox( '#ff8900[sHOP] #ffffffbuy', 255, 255, 255, true ) 
        end 
    end 
end 

Link to comment
dx = { 
     Rectangle ={}; 
} 
  
dx.Rectangle[1] = {356, 184, 640, 382, tocolor(0, 0, 0, 160), false} 
  
function someT() 
     for i,v in ipairs(dx.Rectangle) do 
            dxDrawRectangle(v[1], v[2], v[3], v[4], v[5], v[6]) 
            if ( isMouseInPosition (v[1], v[2], v[3], v[4]) ) then 
                   dx.Rectangle[i][5] = tocolor(0, 0, 0, 100) 
            end 
      end 
end 

ونفس الطريقة لحدث onClientClick

Link to comment
v[1], v[2], v[3], v[4], v[5], v[6]ايش هاي ال

وكيف اخلي فنص الشاشه

هذي القيم الي داخل الجدول

--------------

local sx, sy = guiGetScreenSize() 
x, y, width, height = 100, 200, 400, 400 -- الاحداثيات الي تبي تسويهم في الوسط 
x, y = (sx-width)/2 , (sy-height)/2 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...