Jump to content

مساعدهه


Recommended Posts

not test !

--Server 
addEventHandler ( 'onPlayerWasted', root, 
    function ( ) 
        if getPedWeapon ( source, 38 ) then 
            giveWeapon ( source, 38, 10000 ) 
        else 
            killPed ( source, source ) 
        end 
    end 
) 
  

Link to comment
not test !
--Server 
addEventHandler ( 'onPlayerWasted', root, 
    function ( ) 
        if getPedWeapon ( source, 38 ) then 
            giveWeapon ( source, 38, 10000 ) 
        else 
            killPed ( source, source ) 
        end 
    end 
) 
  

منت فاهم الموضوع + تقتل الاعب في افنت موت الاعب

راح يصير لاق قوي

بالنسبة لصاحب المود

حاول تطفي وتشغل مود مود

عشان تشوف من اي مود المشكلة

بعدين حط اكواد المود

ونشوف لك الحل

Link to comment

لقيت المود حق عناد التوب ~

كلينت

function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Images/img.png", relative2 )
    local mainBackgroundLabel = guiCreateLabel ( 0, 0, 700, 100, "               "..titleBarText2, false, mainBackground )
    guiSetFont ( mainBackgroundLabel, guiCreateFont ( "Fonts/1Font.TTF", 17 ) )
    guiSetEnabled ( mainBackgroundLabel, false )
    return mainBackground
end
 
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
_getPlayerName = getPlayerName
function getPlayerName(player)
    return string.gsub(_getPlayerName(player), "#%x%x%x%x%x%x", "" )
end
 
TopWindow = guiCreateWindow(30, 86, 720, 400, ":: [Z.L] - Top Players ::", false)
guiSetVisible(TopWindow, false)
guiSetAlpha(TopWindow, 1.00)
 
TopDrift = guiCreateStaticImage(10, 28, 140, 76, "Images/drift.png", false, TopWindow)
TopScore = guiCreateStaticImage(10, 115, 140, 76, "Images/score.png", false, TopWindow)
TopTime = guiCreateStaticImage(5, 205, 140, 76, "Images/time.png", false, TopWindow)
TopMoney = guiCreateStaticImage(5, 295, 140, 76, "Images/money.png", false, TopWindow)
guiSetAlpha ( TopDrift, 0.3 )
guiSetAlpha ( TopScore, 0.3 )
guiSetAlpha ( TopTime, 0.3 )
guiSetAlpha ( TopMoney, 0.3 )
centerWindow(TopWindow)
 
font = guiCreateFont ( 'Fonts/Font.TTF', 10 )
DriftList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( DriftList, false )
RankColumn = guiGridListAddColumn(DriftList, "Rank", 0.1)
NameColumn = guiGridListAddColumn(DriftList, "Player Name", 0.5)
TotalColumn = guiGridListAddColumn(DriftList, "[Z.L] Level", 0.3)
guiSetProperty( DriftList, 'Disabled', 'True' )
guiSetAlpha( DriftList, 1 )
guiSetFont( DriftList, font )
guiSetVisible(DriftList, false)
 
ScoreList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( ScoreList, false )
guiGridListAddColumn(ScoreList, "Rank", 0.1)
guiGridListAddColumn(ScoreList, "Player Name", 0.5)
guiGridListAddColumn(ScoreList, "[Z.L] Total Kills", 0.3)
guiSetProperty( ScoreList, 'Disabled', 'True' )
guiSetAlpha( ScoreList, 1 )
guiSetFont( ScoreList, font )
guiSetVisible(ScoreList, false)
 
TimeList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( TimeList, false )
guiGridListAddColumn(TimeList, "Rank", 0.1)
guiGridListAddColumn(TimeList, "Player Name", 0.5)
guiGridListAddColumn(TimeList, "[Z.L] Total Play Time", 0.3)
guiSetProperty( TimeList, 'Disabled', 'True' )
guiSetAlpha( TimeList, 1 )
guiSetFont( TimeList, font )
guiSetVisible(TimeList, false)
 
MoneyList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( MoneyList, false )
guiGridListAddColumn(MoneyList, "Rank", 0.1)
guiGridListAddColumn(MoneyList, "Player Name", 0.5)
guiGridListAddColumn(MoneyList, "[Z.L] Total Money", 0.3)
guiSetProperty( MoneyList, 'Disabled', 'True' )
guiSetAlpha( MoneyList, 1 )
guiSetFont( MoneyList, font )
guiSetVisible(MoneyList, false)
 
addEventHandler ( "onClientMouseEnter", root,
    function ( )
        if source == TopDrift then
            guiSetAlpha ( TopDrift, 1 )
            playSoundFrontEnd ( 3 )
        elseif source == TopScore then
            guiSetAlpha ( TopScore, 1 )
            playSoundFrontEnd ( 3 )
        elseif source == TopTime then
            guiSetAlpha ( TopTime, 1 ) 
            playSoundFrontEnd ( 3 )
        elseif source == TopMoney then
            guiSetAlpha ( TopMoney, 1 ) 
            playSoundFrontEnd ( 3 )        
        end
    end
)
 
addEventHandler ( "onClientMouseLeave", root,
    function ( )
        if source == TopDrift then
            if guiGetVisible ( DriftList ) == false then       
                guiSetAlpha ( TopDrift, 0.3 )
            end
        elseif source == TopScore then
            if guiGetVisible ( ScoreList ) == false then           
                guiSetAlpha ( TopScore, 0.3 )
            end
        elseif source == TopTime then
            if guiGetVisible ( TimeList ) == false then        
                guiSetAlpha ( TopTime, 0.3 )
            end
        elseif source == TopMoney then
            if guiGetVisible ( MoneyList ) == false then           
                guiSetAlpha ( TopMoney, 0.3 )
            end        
        end
    end
)
 
addEventHandler ( "onClientGUIClick", root,
    function ( )
        if source == TopDrift then
            guiSetAlpha ( TopDrift, 1 )
            guiSetAlpha ( TopScore, 0.3 )
            guiSetAlpha ( TopTime, 0.3 )
            guiSetAlpha ( TopMoney, 0.3 )   
            playSoundFrontEnd ( 13 )           
            if guiGetVisible ( DriftList ) == false then
                guiSetVisible ( DriftList, true )
            end
            if guiGetVisible ( ScoreList ) then
                guiSetVisible ( ScoreList, false )
            end
            if guiGetVisible ( TimeList ) then
                guiSetVisible ( TimeList, false )
            end 
            if guiGetVisible ( MoneyList ) then
                guiSetVisible ( MoneyList, false )
            end            
        elseif source == TopScore then
            guiSetAlpha ( TopDrift, 0.3 )
            guiSetAlpha ( TopScore, 1 )
            guiSetAlpha ( TopTime, 0.3 )
            guiSetAlpha ( TopMoney, 0.3 )   
            playSoundFrontEnd ( 13 )
            if guiGetVisible ( ScoreList ) == false then
                guiSetVisible ( ScoreList, true )
            end
            if guiGetVisible ( DriftList ) then
                guiSetVisible ( DriftList, false )
            end 
            if guiGetVisible ( TimeList ) then
                guiSetVisible ( TimeList, false )
            end
            if guiGetVisible ( MoneyList ) then
                guiSetVisible ( MoneyList, false )
            end            
        elseif source == TopTime then
            guiSetAlpha ( TopDrift, 0.3 )
            guiSetAlpha ( TopScore, 0.3 )
            guiSetAlpha ( TopTime, 1 ) 
            guiSetAlpha ( TopMoney, 0.3 )   
            playSoundFrontEnd ( 13 )
            if guiGetVisible ( TimeList ) == false then
                guiSetVisible ( TimeList, true )
            end
            if guiGetVisible ( DriftList ) then
                guiSetVisible ( DriftList, false )
            end 
            if guiGetVisible ( ScoreList ) then
                guiSetVisible ( ScoreList, false )
            end 
            if guiGetVisible ( MoneyList ) then
                guiSetVisible ( MoneyList, false )
            end 
        elseif source == TopMoney then
            guiSetAlpha ( TopDrift, 0.3 )
            guiSetAlpha ( TopScore, 0.3 )
            guiSetAlpha ( TopTime, 0.3 )   
            guiSetAlpha ( TopMoney, 1 )    
            playSoundFrontEnd ( 13 )
            if guiGetVisible ( MoneyList ) == false then
                guiSetVisible ( MoneyList, true )
            end
            if guiGetVisible ( DriftList ) then
                guiSetVisible ( DriftList, false )
            end 
            if guiGetVisible ( ScoreList ) then
                guiSetVisible ( ScoreList, false )
            end 
            if guiGetVisible ( TimeList ) then
                guiSetVisible ( TimeList, false )          
            end
        end
    end
)
 
function convertNumber ( number )  
    local formatted = number  
    while true do      
        formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')    
        if ( k==0 ) then      
            break  
        end  
    end  
    return formatted
end
 
function getPlayersSortByDrif( )
    local Top = { }
    for _, aPlayer in next, getElementsByType 'player' do
        table.insert (
        Top,
        {
            player = aPlayer,
            aDrif = getElementData ( aPlayer, 'Level' ) or 0
        }
    )
    end
        table.sort(
        Top,
        function( a, b )
            return( tonumber( a.aDrif ) or 0 ) > ( tonumber( b.aDrif ) or 0 )
        end
    )
    return Top
end
 
function getPlayersSortByaScore( )
    local TopScore = { }
    for _, aPlayer in next, getElementsByType 'player' do
        table.insert (
        TopScore,
        {
            player = aPlayer,
            aScore = getElementData ( aPlayer, 'kills' ) or 0
        }
    )
    end
        table.sort(
        TopScore,
        function( a, b )
            return( tonumber( a.aScore ) or 0 ) > ( tonumber( b.aScore ) or 0 )
        end
    )
    return TopScore
end
 
function getPlayersSortByaTime( )
    local TopTimer = { }
    for _, aPlayer in next, getElementsByType 'player' do
        Time = getElementData ( aPlayer, 'Time' ) or "0:0:0"
        local h, m, s = unpack ( split ( Time, ":" ) ) 
        table.insert (
            TopTimer,
           
Link to comment
لقيت المود حق عناد التوب ~

كلينت

function guiCreateWindow(x2, y2, width2, height2, titleBarText2, relative2) 
    local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Images/img.png", relative2 )
    local mainBackgroundLabel = guiCreateLabel ( 0, 0, 700, 100, "               "..titleBarText2, false, mainBackground )
    guiSetFont ( mainBackgroundLabel, guiCreateFont ( "Fonts/1Font.TTF", 17 ) )
    guiSetEnabled ( mainBackgroundLabel, false )
    return mainBackground
end
 
function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false)
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false)
end
 
_getPlayerName = getPlayerName
function getPlayerName(player)
    return string.gsub(_getPlayerName(player), "#%x%x%x%x%x%x", "" )
end
 
TopWindow = guiCreateWindow(30, 86, 720, 400, ":: [Z.L] - Top Players ::", false)
guiSetVisible(TopWindow, false)
guiSetAlpha(TopWindow, 1.00)
 
TopDrift = guiCreateStaticImage(10, 28, 140, 76, "Images/drift.png", false, TopWindow)
TopScore = guiCreateStaticImage(10, 115, 140, 76, "Images/score.png", false, TopWindow)
TopTime = guiCreateStaticImage(5, 205, 140, 76, "Images/time.png", false, TopWindow)
TopMoney = guiCreateStaticImage(5, 295, 140, 76, "Images/money.png", false, TopWindow)
guiSetAlpha ( TopDrift, 0.3 )
guiSetAlpha ( TopScore, 0.3 )
guiSetAlpha ( TopTime, 0.3 )
guiSetAlpha ( TopMoney, 0.3 )
centerWindow(TopWindow)
 
font = guiCreateFont ( 'Fonts/Font.TTF', 10 )
DriftList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( DriftList, false )
RankColumn = guiGridListAddColumn(DriftList, "Rank", 0.1)
NameColumn = guiGridListAddColumn(DriftList, "Player Name", 0.5)
TotalColumn = guiGridListAddColumn(DriftList, "[Z.L] Level", 0.3)
guiSetProperty( DriftList, 'Disabled', 'True' )
guiSetAlpha( DriftList, 1 )
guiSetFont( DriftList, font )
guiSetVisible(DriftList, false)
 
ScoreList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( ScoreList, false )
guiGridListAddColumn(ScoreList, "Rank", 0.1)
guiGridListAddColumn(ScoreList, "Player Name", 0.5)
guiGridListAddColumn(ScoreList, "[Z.L] Total Kills", 0.3)
guiSetProperty( ScoreList, 'Disabled', 'True' )
guiSetAlpha( ScoreList, 1 )
guiSetFont( ScoreList, font )
guiSetVisible(ScoreList, false)
 
TimeList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( TimeList, false )
guiGridListAddColumn(TimeList, "Rank", 0.1)
guiGridListAddColumn(TimeList, "Player Name", 0.5)
guiGridListAddColumn(TimeList, "[Z.L] Total Play Time", 0.3)
guiSetProperty( TimeList, 'Disabled', 'True' )
guiSetAlpha( TimeList, 1 )
guiSetFont( TimeList, font )
guiSetVisible(TimeList, false)
 
MoneyList = guiCreateGridList(160, 29, 550, 335, false, TopWindow)
guiGridListSetSortingEnabled( MoneyList, false )
guiGridListAddColumn(MoneyList, "Rank", 0.1)
guiGridListAddColumn(MoneyList, "Player Name", 0.5)
guiGridListAddColumn(MoneyList, "[Z.L] Total Money", 0.3)
guiSetProperty( MoneyList, 'Disabled', 'True' )
guiSetAlpha( MoneyList, 1 )
guiSetFont( MoneyList, font )
guiSetVisible(MoneyList, false)
 
addEventHandler ( "onClientMouseEnter", root,
    function ( )
        if source == TopDrift then
            guiSetAlpha ( TopDrift, 1 )
            playSoundFrontEnd ( 3 )
        elseif source == TopScore then
            guiSetAlpha ( TopScore, 1 )
            playSoundFrontEnd ( 3 )
        elseif source == TopTime then
            guiSetAlpha ( TopTime, 1 ) 
            playSoundFrontEnd ( 3 )
        elseif source == TopMoney then
            guiSetAlpha ( TopMoney, 1 ) 
            playSoundFrontEnd ( 3 )        
        end
    end
)
 
addEventHandler ( "onClientMouseLeave", root,
    function ( )
        if source == TopDrift then
            if guiGetVisible ( DriftList ) == false then       
                guiSetAlpha ( TopDrift, 0.3 )
            end
        elseif source == TopScore then
            if guiGetVisible ( ScoreList ) == false then           
                guiSetAlpha ( TopScore, 0.3 )
            end
        elseif source == TopTime then
            if guiGetVisible ( TimeList ) == false then        
                guiSetAlpha ( TopTime, 0.3 )
            end
        elseif source == TopMoney then
            if guiGetVisible ( MoneyList ) == false then           
                guiSetAlpha ( TopMoney, 0.3 )
            end        
        end
    end
)
 
addEventHandler ( "onClientGUIClick", root,
    function ( )
        if source == TopDrift then
            guiSetAlpha ( TopDrift, 1 )
            guiSetAlpha ( TopScore, 0.3 )
            guiSetAlpha ( TopTime, 0.3 )
            guiSetAlpha ( TopMoney, 0.3 )   
            playSoundFrontEnd ( 13 )           
            if guiGetVisible ( DriftList ) == false then
                guiSetVisible ( DriftList, true )
            end
            if guiGetVisible ( ScoreList ) then
                guiSetVisible ( ScoreList, false )
            end
            if guiGetVisible ( TimeList ) then
                guiSetVisible ( TimeList, false )
            end 
            if guiGetVisible ( MoneyList ) then
                guiSetVisible ( MoneyList, false )
            end            
        elseif source == TopScore then
            guiSetAlpha ( TopDrift, 0.3 )
            guiSetAlpha ( TopScore, 1 )
            guiSetAlpha ( TopTime, 0.3 )
            guiSetAlpha ( TopMoney, 0.3 )   
            playSoundFrontEnd ( 13 )
            if guiGetVisible ( ScoreList ) == false then
                guiSetVisible ( ScoreList, true )
            end
            if guiGetVisible ( DriftList ) then
                guiSetVisible ( DriftList, false )
            end 
            if guiGetVisible ( TimeList ) then
                guiSetVisible ( TimeList, false )
            end
            if guiGetVisible ( MoneyList ) then
                guiSetVisible ( MoneyList, false )
            end            
        elseif source == TopTime then
            guiSetAlpha ( TopDrift, 0.3 )
            guiSetAlpha ( TopScore, 0.3 )
            guiSetAlpha ( TopTime, 1 ) 
            guiSetAlpha ( TopMoney, 0.3 )   
            playSoundFrontEnd ( 13 )
            if guiGetVisible ( TimeList ) == false then
                guiSetVisible ( TimeList, true )
            end
            if guiGetVisible ( DriftList ) then
                guiSetVisible ( DriftList, false )
            end 
            if guiGetVisible ( ScoreList ) then
                guiSetVisible ( ScoreList, false )
            end 
            if guiGetVisible ( MoneyList ) then
                guiSetVisible ( MoneyList, false )
            end 
        elseif source == TopMoney then
            guiSetAlpha ( TopDrift, 0.3 )
            guiSetAlpha ( TopScore, 0.3 )
            guiSetAlpha ( TopTime, 0.3 )   
            guiSetAlpha ( TopMoney, 1 )    
            playSoundFrontEnd ( 13 )
            if guiGetVisible ( MoneyList ) == false then
                guiSetVisible ( MoneyList, true )
            end
            if guiGetVisible ( DriftList ) then
                guiSetVisible ( DriftList, false )
            end 
            if guiGetVisible ( ScoreList ) then
                guiSetVisible ( ScoreList, false )
            end 
            if guiGetVisible ( TimeList ) then
                guiSetVisible ( TimeList, false )          
            end
        end
    end
)
 
function convertNumber ( number )  
    local formatted = number  
    while true do      
        formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')    
        if ( k==0 ) then      
            break  
        end  
    end  
    return formatted
end
 
function getPlayersSortByDrif( )
    local Top = { }
    for _, aPlayer in next, getElementsByType 'player' do
        table.insert (
        Top,
        {
            player = aPlayer,
            aDrif = getElementData ( aPlayer, 'Level' ) or 0
        }
    )
    end
        table.sort(
        Top,
        function( a, b )
            return( tonumber( a.aDrif ) or 0 ) > ( tonumber( b.aDrif ) or 0 )
        end
    )
    return Top
end
 
function getPlayersSortByaScore( )
    local TopScore = { }
    for _, aPlayer in next, getElementsByType 'player' do
        table.insert (
        TopScore,
        {
            player = aPlayer,
            aScore = getElementData ( aPlayer, 'kills' ) or 0
        }
    )
    end
        table.sort(
        TopScore,
        function( a, b )
            return( tonumber( a.aScore ) or 0 ) > ( tonumber( b.aScore ) or 0 )
        end
    )
    return TopScore
end
 
function getPlayersSortByaTime( )
    local TopTimer = { }
    for _, aPlayer in next, getElementsByType 'player' do
        Time = getElementData ( aPlayer, 'Time' ) or "0:0:0"
       
Link to comment

بساعدك شوي

وانت حاول تسوي الكود بطريقتك

-- Client 
po=500 --  500 = عدد الطلقات اللي تبي تسحبها 
getPedWeapon(...) -- استبدل النقاط الثلاث باللاعب اللي تبي تسحب الرصاص حقه 
amm = getWeaponAmmo(weapon) -- هذا الكود يشتغل على بعض الاصدارات السابقه 
triggerServerEvent -- With variables : "amm", "weapon", "po"  
  
-- Server 
addEvent -- ^ 
addEventHandler 
setWeaponAmmo(weapon, amm - po) 

getWeaponAmmo -- عشان تعرف كيف تشغل الوظيفة

خش الرابط اللي تحت و اقرأ عن الميتا

لازم تضيف شيء للميتا عشان تشتغل الوظيفة ^

meta.xml

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...