Jump to content

تصحيح كود


Recommended Posts

ممآ صآر يشتغل آصصلآ ،

ي عنآد آنآ معي ترآيقرين

وآحد nothing = لـ سيآرةة

nothing2 = للففلوسس

addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == GUIEditor.button[3] then 
            if getPlayerMoney ( localPlayer ) >= 2350 then 
                triggerServerEvent ( "nothing", localPlayer, localPlayer ) 
                guiSetVisible ( GUIEditor.window[2], false ) 
                showCursor ( false ) 
            else 
                outputChatBox ( "You do not have enough money !", 255, 0, 0, true )  
            end 
        end 
    end 
) 

وليه مسوي ترايقرين ؟؟

اجمع الوظيفتين بترايقر واحد

--

player = ??

^ الغلط هو اني نسيت احطه بالأرقومنت

triggerServerEvent ( "nothing", localPlayer, localPlayer ) 

Link to comment

عيآل الححين لممآ حآولت شوي آنظمم الكود ..

صصصآر العكس ..

لمآ يكون مآ عندهه الففلوس مآ يعطيه الشي

بس إذآ عندهه مآ يعطيه شي بعد

الكودآت

..

    GUIEditor = { 
        button = {}, 
        window = {}, 
        label = {} 
    } 
            GUIEditor.window[1] = guiCreateWindow(477, 224, 302, 140, ".| Boat Rental ! |.", false) 
            guiWindowSetSizable(GUIEditor.window[1], false) 
            guiWindowSetMovable(GUIEditor.window[1], false)   
            guiSetAlpha(GUIEditor.window[1], 1.00) 
            guiSetVisible(GUIEditor.window[1],false) 
            GUIEditor.label[1] = guiCreateLabel(74, 26, 172, 17, "Do You Want Rental a Boat ? !", false, GUIEditor.window[1]) 
            guiLabelSetColor(GUIEditor.label[1], 5, 249, 5) 
            GUIEditor.button[1] = guiCreateButton(183, 53, 103, 50, "No , i Don't !", false, GUIEditor.window[1]) 
            guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFC0000") 
            GUIEditor.label[2] = guiCreateLabel(165, 113, 131, 17, "Created By #iR4y[b]ak", false, GUIEditor.window[1]) 
            guiLabelSetColor(GUIEditor.label[2], 4, 147, 247) 
            GUIEditor.button[2] = guiCreateButton(34, 53, 103, 50, "Yes , i Want !", false, GUIEditor.window[1]) 
            guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFD2F00D") 
            GUIEditor.window[2] = guiCreateWindow(521, 239, 256, 161, ".| The Confirmation ! |.", false) 
            guiSetVisible(GUIEditor.window[2],false) 
            guiWindowSetMovable(GUIEditor.window[2], false) 
            guiWindowSetSizable(GUIEditor.window[2], false) 
            guiSetAlpha(GUIEditor.window[2], 1.00) 
      
            GUIEditor.label[3] = guiCreateLabel(81, 27, 93, 20, "Are You Sure ? !", false, GUIEditor.window[2]) 
            guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) 
            GUIEditor.label[4] = guiCreateLabel(41, 63, 175, 19, "you Want To Rent The Boat At :", false, GUIEditor.window[2]) 
            guiLabelSetColor(GUIEditor.label[4], 8, 170, 246) 
            GUIEditor.label[5] = guiCreateLabel(106, 92, 58, 18, "2350 $ .. '", false, GUIEditor.window[2]) 
            guiLabelSetColor(GUIEditor.label[5], 15, 243, 10) 
            GUIEditor.button[3] = guiCreateButton(27, 110, 69, 33, "Yes !", false, GUIEditor.window[2]) 
            guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFE55A16") 
            GUIEditor.button[4] = guiCreateButton(174, 110, 69, 33, "No !", false, GUIEditor.window[2]) 
            guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFA08C9")     
        
    local Marker = createMarker ( -1520.64453, 1014.02814, 7.18750 - 1, "cylinder",2,255,0,0.5,255) 
    createBlipAttachedTo(Marker,23) 
      
    addEventHandler("onClientMarkerHit", Marker, 
    function (player) 
        if (getElementType(player) == ("player") ) then 
        guiSetVisible(GUIEditor.window[1],true) 
        showCursor(true) 
    end 
    end 
    ) 
    addEventHandler("onClientGUIClick", root, 
    function () 
    if source == GUIEditor.button[1] then 
       guiSetVisible(GUIEditor.window[1],false) 
      showCursor(false) 
    end 
    end 
    ) 
      
    addEventHandler("onClientGUIClick", root, 
      
    function () 
    if source == GUIEditor.button[2] then 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
     if ( guiGetVisible ( GUIEditor.window[1] ) == false ) then 
    guiSetVisible(GUIEditor.window[2],true) 
    showCursor(true) 
    end 
    end 
    end 
    ) 
      
    addEventHandler("onClientGUIClick", root, 
      
    function () 
      
    if source == GUIEditor.button[4] then 
      
    guiSetVisible(GUIEditor.window[2],false) 
    showCursor(false) 
    end 
    end 
    ) 
      
      
  
    addEventHandler ( "onClientGUIClick", root, 
        function ( ) 
            if source == GUIEditor.button[3] then 
                if getPlayerMoney ( localPlayer ) >= 2350 then 
                    triggerServerEvent ( "nothing", localPlayer, localPlayer ) 
                    guiSetVisible ( GUIEditor.window[2], false ) 
                    showCursor ( false ) 
                else 
                    outputChatBox ( "You do not have enough money !", 255, 0, 0, true ) 
                end 
            end 
        end 
    ) 

السيرفر

  
    Vehicle = {} 
      
    addEvent("nothing", true) 
    addEventHandler("nothing",getRootElement(),function () 
        if not Vehicle[source] then 
            Vehicle[source] = {} 
        end 
        if isElement ( Vehicle[source]['myBilp'] ) then               
            destroyElement(Vehicle[source]['myBilp'])    
        elseif isElement ( Vehicle[source]['myVehicle'] ) then 
            destroyElement(Vehicle[source]['myVehicle']) 
        end 
        Vehicle[source]['myVehicle'] = createVehicle ( 473,-1457.09363,1022.52289,0.67758,0.89540588855743,2.3755996153341e-005,269.57095336914 ) 
        warpPedIntoVehicle(source,Vehicle[source]['myVehicle']) 
        Vehicle[source]['myBilp'] = createBlipAttachedTo(Vehicle[source]['myVehicle'],9) 
        setElementModel(source,45) 
    end 
        takePlayerMoney ( player, 2350 ) 
    end 
) 
      
    addEventHandler("onVehicleStartExit",getRootElement(), 
        function (plr) 
            if ( Vehicle[plr] and Vehicle[plr]['myVehicle'] and isElement ( Vehicle[plr]['myVehicle'] ) ) then 
               cancelEvent( true ) 
            end 
        end 
    ) 
      
    addEventHandler("onPlayerQuit",root, 
        function ( ) 
            if ( Vehicle[source] ) then 
                if isElement ( Vehicle[source]['myBilp'] ) then   
                    destroyElement(Vehicle[source]['myBilp'])           
                elseif isElement ( Vehicle[source]['myVehicle'] ) then 
                    destroyElement(Vehicle[source]['myVehicle']) 
                end 
                Vehicle[source] = nil 
            end 
        end 
    ) 
  
local Marker2 = createMarker ( -1481.17139, 1029.08521, -0.55000, "checkpoint",10,255,0,0.5,255) 
  
addEventHandler("onMarkerHit",Marker2, 
function () 
  local car = getPedOccupiedVehicle(source) 
                if car then 
                destroyElement ( car ) 
end 
end 
) 

Link to comment

لم يتم التجربة

-- Client Side 
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == GUIEditor.button[3] then 
            if ( getPlayerMoney ( ) >= 2350 ) then 
                triggerServerEvent ( "nothing", localPlayer, localPlayer ) 
                guiSetVisible ( GUIEditor.window[2], false ) 
                showCursor ( false ) 
            else 
                outputChatBox ( "You do not have enough money !", 255, 0, 0, true ) 
            end 
        elseif source == GUIEditor.button[1] then 
            guiSetVisible ( GUIEditor.window[1], false ) 
            showCursor ( false ) 
        elseif source == GUIEditor.button[2] then 
            guiSetVisible ( GUIEditor.window[1], false ) 
            showCursor ( false ) 
                if not guiGetVisible ( GUIEditor.window[1] ) then 
                    guiSetVisible ( GUIEditor.window[2], true ) 
                    showCursor ( true ) 
                end 
        elseif source == GUIEditor.button[4] then   
            guiSetVisible ( GUIEditor.window[2], false ) 
            showCursor ( false ) 
        end 
    end 
) 

-- Server Side 
Vehicle = { } 
      
addEvent ( "nothing", true ) 
addEventHandler ( "nothing", root, 
    function ( player ) 
        if not Vehicle[player] then 
            Vehicle[player] = {} 
        end 
        if isElement ( Vehicle[player]['myBilp'] ) then               
            destroyElement(Vehicle[player]['myBilp'])   
        elseif isElement ( Vehicle[player]['myVehicle'] ) then 
            destroyElement(Vehicle[player]['myVehicle']) 
        end 
        Vehicle[player]['myVehicle'] = createVehicle ( 473,-1457.09363,1022.52289,0.67758,0.89540588855743,2.3755996153341e-005,269.57095336914 ) 
        warpPedIntoVehicle(player,Vehicle[player]['myVehicle']) 
        Vehicle[player]['myBilp'] = createBlipAttachedTo ( Vehicle[player]['myVehicle'], 9 ) 
        setElementModel ( player, 45 ) 
        takePlayerMoney ( player, 2350 ) 
    end 
) 

Link to comment
لم يتم التجربة
-- Client Side 
addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        if source == GUIEditor.button[3] then 
            if ( getPlayerMoney ( ) >= 2350 ) then 
                triggerServerEvent ( "nothing", localPlayer, localPlayer ) 
                guiSetVisible ( GUIEditor.window[2], false ) 
                showCursor ( false ) 
            else 
                outputChatBox ( "You do not have enough money !", 255, 0, 0, true ) 
            end 
        elseif source == GUIEditor.button[1] then 
            guiSetVisible ( GUIEditor.window[1], false ) 
            showCursor ( false ) 
        elseif source == GUIEditor.button[2] then 
            guiSetVisible ( GUIEditor.window[1], false ) 
            showCursor ( false ) 
                if not guiGetVisible ( GUIEditor.window[1] ) then 
                    guiSetVisible ( GUIEditor.window[2], true ) 
                    showCursor ( true ) 
                end 
        elseif source == GUIEditor.button[4] then   
            guiSetVisible ( GUIEditor.window[2], false ) 
            showCursor ( false ) 
        end 
    end 
) 

-- Server Side 
Vehicle = { } 
      
addEvent ( "nothing", true ) 
addEventHandler ( "nothing", root, 
    function ( player ) 
        if not Vehicle[player] then 
            Vehicle[player] = {} 
        end 
        if isElement ( Vehicle[player]['myBilp'] ) then               
            destroyElement(Vehicle[player]['myBilp'])   
        elseif isElement ( Vehicle[player]['myVehicle'] ) then 
            destroyElement(Vehicle[player]['myVehicle']) 
        end 
        Vehicle[player]['myVehicle'] = createVehicle ( 473,-1457.09363,1022.52289,0.67758,0.89540588855743,2.3755996153341e-005,269.57095336914 ) 
        warpPedIntoVehicle(player,Vehicle[player]['myVehicle']) 
        Vehicle[player]['myBilp'] = createBlipAttachedTo ( Vehicle[player]['myVehicle'], 9 ) 
        setElementModel ( player, 45 ) 
        takePlayerMoney ( player, 2350 ) 
    end 
) 

حق دوران السيارة Y فيه غلط بسطر 15 بجانب سيرفر بإحداثي ..

Vehicle[player]['myVehicle'] = createVehicle ( 473,-1457.09363,1022.52289,0.67758,0.89540588855743,2.3755996153341-005,269.57095336914 ) 

Link to comment
آي كذآ ظظبطط ..

بس الممشكلةة اللآعب يققدر ينزل من السيآرةة

آبيه زي الكود حققي فوقق

- سيرففر

منيب مرتاح من كودك

addEventHandler ( "onVehicleStartExit", root, 
    function ( plr ) 
        if Vehicle[plr] and Vehicle[plr]['myVehicle'] and isElement ( Vehicle[plr]['myVehicle'] ) then 
            cancelEvent( true ) 
        end 
    end 
) 

اظن لو تحققت الشروط السابقة

- جداول اللاعب موجودة

- السيارة موجودة

مراح تنزل من أي سيارة ثآنية ابد

Link to comment

يمكن كذا؟ :?

addEventHandler ( "onVehicleStartExit", root, 
    function (player) 
        if Vehicle[player] and Vehicle[player]['myVehicle'] and isElement (Vehicle[player]['myVehicle'] ) then 
            cancelEvent() 
        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...