Jump to content

تعديل


Recommended Posts

السلام عليكم

عندي وظيفة المهندس

اللي يصلح السسيارات المهم

ابي اذآ كتبت في اف8

fix

هو يصلح الموتر بسرعة ابيه انا

ماهو بسرعة يطلع تحت عد تصاعدي للـ 100

ويصلحه~

وبسس الكود~

Teame = createTeam("Mechnical", 255, 255, 0) 
taxiTeams = { [Teame] = true } 
taxiVehs = { [525] = true } 
function teamSet ( ) 
    local team = getTeamFromName ( "Mechnical" ) 
    if team then 
        setPlayerTeam ( source, team ) 
        setPlayerNametagColor ( source, 255, 255, 0 ) 
            setElementModel(source, 50) 
            createVehicle(525, 1041.37878, -1028.65613, 32.10156) 
        else 
            local teamw = getTeamFromName ( "Mechnical" ) 
            if teamw then 
            cancelEvent() 
        end 
    end 
end 
addEvent ( "sTeame", true) 
addEventHandler ( "sTeame", root, teamSet ) 
  
  
function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle 
    if getElementType ( thePlayer ) == "player" then 
        if ( taxiVehs[getElementModel ( source )] ) and ( not taxiTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin 
            removePedFromVehicle( thePlayer )-- force the player out of the vehicle 
        end 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 
  
  
  
markers = { } 
blips = { } 
peds = { } 
mposi = { } 
mposii = {} 
  
  
  
  
function startJob ( thePlayer ) 
    local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) 
    markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) 
    mposi = { getElementPosition( markers [ thePlayer ] ) } 
    local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) 
    peds [ thePlayer ] = createPed( skins, x, y, z )   
    blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 ) 
    addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) 
    end 
  
function inVEH ( thePlayer ) 
    if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then 
        if ( getElementModel ( source ) == 420 ) then 
            startJob ( thePlayer ) 
        end 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) 
  
function warpit ( thePlayer ) 
    if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then 
       local vehiclee = getPedOccupiedVehicle ( thePlayer ) 
        if ( getElementModel ( vehiclee ) == 420 ) then 
            setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 ) 
            destroyJob ( thePlayer ) 
            local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) 
            markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 255, 0, 0, 50 ) 
            mposii = { getElementPosition( markers [ thePlayer ] ) } 
            blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) 
            addEventHandler ( "onMarkerHit", markers [ thePlayer ], pickmeup ) 
            end 
            end 
        end 
  
  
function pickmeup ( thePlayer ) 
    if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then 
        destroyJob ( thePlayer ) 
        local mx, my, mz = unpack ( mposi ) 
        local mmx, mmy, mmz = unpack ( mposii ) 
        local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) 
        finalmoney = math.floor ( money ) 
        if finalmoney then 
        setTimer( givePlayerMoney, 3000, 1, thePlayer, finalmoney ) 
        setTimer( outputChatBox, 3000, 1, thePlayer, "You have earned ".. money .."!", 0, 144, 0) 
        setTimer ( 
            function ( ) 
                if ( isElement ( peds [ thePlayer ] ) ) then 
                    destroyElement ( peds [ thePlayer ] ) 
                end 
                startJob ( thePlayer ) 
            end 
            ,3000, 1 
        ) 
            end 
        end 
    end 
  
function deleteOnExit ( thePlayer ) 
    if ( isElement ( markers [ thePlayer ] ) ) then 
        destroyElement ( markers [ thePlayer ] ) 
    end 
    if ( isElement ( blips [ thePlayer ] ) ) then 
        destroyElement ( blips [ thePlayer ] ) 
    end 
    if ( isElement ( peds [ thePlayer ] ) ) then 
        destroyElement ( peds [ thePlayer ] ) 
    end 
end 
addEventHandler ( "onVehicleExit", getRootElement(), deleteOnExit ) 
  
  
function destroyJob ( thePlayer ) 
    if ( isElement ( markers [ thePlayer ] ) ) then 
        destroyElement ( markers [ thePlayer ] ) 
    end 
    if ( isElement ( blips [ thePlayer ] ) ) then 
        destroyElement( blips [ thePlayer ] ) 
    end 
end 
  
function consoleSetPlayerPosition ( source, commandName, posX, posY, posZ ) 
    setElementPosition ( source, posX, posY, posZ ) 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition  ) 
  
  
addCommandHandler( 'fix', 
    function( aPlayer ) 
        if getPlayerTeam( aPlayer ) and ( getTeamName( getPlayerTeam( aPlayer ) ) == 'Mechnical' ) then 
            for _, aV in pairs ( getElementsByType 'vehicle' ) do 
                if ( getElementHealth( aV ) <= 999 ) then 
                    local pX, pY, pZ = getElementPosition( aPlayer ) 
                    local vX, vY, vZ = getElementPosition( aV ) 
                    if ( getDistanceBetweenPoints3D( pX, pY, pZ, vX, vY, vZ ) <= 4 ) then 
                        fixVehicle( aV ) 
                        givePlayerMoney( aPlayer, 1000 ) 
                    end 
                end 
            end 
        end 
    end 
) 

Link to comment
السلام عليكم

عندي وظيفة المهندس

اللي يصلح السسيارات المهم

ابي اذآ كتبت في اف8

fix

هو يصلح الموتر بسرعة ابيه انا

ماهو بسرعة يطلع تحت عد تصاعدي للـ 100

ويصلحه~

وبسس الكود~

Teame = createTeam("Mechnical", 255, 255, 0) 
taxiTeams = { [Teame] = true } 
taxiVehs = { [525] = true } 
function teamSet ( ) 
    local team = getTeamFromName ( "Mechnical" ) 
    if team then 
        setPlayerTeam ( source, team ) 
        setPlayerNametagColor ( source, 255, 255, 0 ) 
            setElementModel(source, 50) 
            createVehicle(525, 1041.37878, -1028.65613, 32.10156) 
        else 
            local teamw = getTeamFromName ( "Mechnical" ) 
            if teamw then 
            cancelEvent() 
        end 
    end 
end 
addEvent ( "sTeame", true) 
addEventHandler ( "sTeame", root, teamSet ) 
  
  
function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle 
    if getElementType ( thePlayer ) == "player" then 
        if ( taxiVehs[getElementModel ( source )] ) and ( not taxiTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin 
            removePedFromVehicle( thePlayer )-- force the player out of the vehicle 
        end 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 
  
  
  
markers = { } 
blips = { } 
peds = { } 
mposi = { } 
mposii = {} 
  
  
  
  
function startJob ( thePlayer ) 
    local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) 
    markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 5.0, 255, 0, 0, 0 ) 
    mposi = { getElementPosition( markers [ thePlayer ] ) } 
    local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) 
    peds [ thePlayer ] = createPed( skins, x, y, z )   
    blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 58 ) 
    addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) 
    end 
  
function inVEH ( thePlayer ) 
    if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then 
        if ( getElementModel ( source ) == 420 ) then 
            startJob ( thePlayer ) 
        end 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), inVEH ) 
  
function warpit ( thePlayer ) 
    if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then 
       local vehiclee = getPedOccupiedVehicle ( thePlayer ) 
        if ( getElementModel ( vehiclee ) == 420 ) then 
            setTimer ( warpPedIntoVehicle, 2000, 1, peds [ thePlayer ], vehiclee, 2 ) 
            destroyJob ( thePlayer ) 
            local x, y, z = unpack ( dropoffss [ math.random ( #dropoffss ) ] ) 
            markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 5.0, 255, 0, 0, 50 ) 
            mposii = { getElementPosition( markers [ thePlayer ] ) } 
            blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) 
            addEventHandler ( "onMarkerHit", markers [ thePlayer ], pickmeup ) 
            end 
            end 
        end 
  
  
function pickmeup ( thePlayer ) 
    if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then 
        destroyJob ( thePlayer ) 
        local mx, my, mz = unpack ( mposi ) 
        local mmx, mmy, mmz = unpack ( mposii ) 
        local money = getDistanceBetweenPoints2D ( mx, my, mmx, mmy ) 
        finalmoney = math.floor ( money ) 
        if finalmoney then 
        setTimer( givePlayerMoney, 3000, 1, thePlayer, finalmoney ) 
        setTimer( outputChatBox, 3000, 1, thePlayer, "You have earned ".. money .."!", 0, 144, 0) 
        setTimer ( 
            function ( ) 
                if ( isElement ( peds [ thePlayer ] ) ) then 
                    destroyElement ( peds [ thePlayer ] ) 
                end 
                startJob ( thePlayer ) 
            end 
            ,3000, 1 
        ) 
            end 
        end 
    end 
  
function deleteOnExit ( thePlayer ) 
    if ( isElement ( markers [ thePlayer ] ) ) then 
        destroyElement ( markers [ thePlayer ] ) 
    end 
    if ( isElement ( blips [ thePlayer ] ) ) then 
        destroyElement ( blips [ thePlayer ] ) 
    end 
    if ( isElement ( peds [ thePlayer ] ) ) then 
        destroyElement ( peds [ thePlayer ] ) 
    end 
end 
addEventHandler ( "onVehicleExit", getRootElement(), deleteOnExit ) 
  
  
function destroyJob ( thePlayer ) 
    if ( isElement ( markers [ thePlayer ] ) ) then 
        destroyElement ( markers [ thePlayer ] ) 
    end 
    if ( isElement ( blips [ thePlayer ] ) ) then 
        destroyElement( blips [ thePlayer ] ) 
    end 
end 
  
function consoleSetPlayerPosition ( source, commandName, posX, posY, posZ ) 
    setElementPosition ( source, posX, posY, posZ ) 
end 
addCommandHandler ( "setpos", consoleSetPlayerPosition  ) 
  
  
addCommandHandler( 'fix', 
    function( aPlayer ) 
        if getPlayerTeam( aPlayer ) and ( getTeamName( getPlayerTeam( aPlayer ) ) == 'Mechnical' ) then 
            for _, aV in pairs ( getElementsByType 'vehicle' ) do 
                if ( getElementHealth( aV ) <= 999 ) then 
                    local pX, pY, pZ = getElementPosition( aPlayer ) 
                    local vX, vY, vZ = getElementPosition( aV ) 
                    if ( getDistanceBetweenPoints3D( pX, pY, pZ, vX, vY, vZ ) <= 4 ) then 
                        fixVehicle( aV ) 
                        givePlayerMoney( aPlayer, 1000 ) 
                    end 
                end 
            end 
        end 
    end 
) 

ههريسة كودك

كله نسخ × لصق

ومو مهندس

": ميكانيكي

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