Jump to content

مساعده/تعديل في


Recommended Posts

السلام عليكم

شباب اريد مساعده في التالي

Sanchez لا استطيع ركوب الدراجه و اريد نقل الاعب داخل الدراجه لكي يقودها عندما يضفط علي

marker1 = createMarker(1543.01550,-1719.50916,12.55456,"cylinder",3,255,255,255) 
function spawn() 
  
      
GUIEditor = { 
    button = {}, 
    window = {} 
} 
  
        GUIEditor.window[1] = guiCreateWindow(238, 130, 492, 333, "INRU Spawner", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        GUIEditor.button[2] = guiCreateButton(386, 24, 96, 55, "Close", false, GUIEditor.window[1]) 
  
        GUIEditor.button[1] = guiCreateButton(9, 22, 103, 50, "Sanchez", false, GUIEditor.window[1]) 
            
        showCursor ( true )   
  
end 
addEventHandler("onClientMarkerHit",getRootElement(),spawn) 
  
  
  
addEventHandler("onClientGUIClick",root, 
function ( ) 
if ( source == GUIEditor.button[2]) then 
        guiSetVisible(GUIEditor.window[1],false) 
            showCursor(false) 
                guiSetInputEnabled(false) 
end 
end) 
  
addEventHandler("onClientGUIClick",root, 
function ( thePlayer ) 
if ( source == GUIEditor.button[1]) then 
        guiSetVisible(GUIEditor.window[1],false) 
            showCursor(false) 
             
                guiSetInputEnabled(false) 
                 
                local luckyBugger = getLocalPlayer() 
      local x, y, z = getElementPosition ( luckyBugger )  
  
    veh = createVehicle ( 468, x, y, z + 10 )  
       warpPedIntoVehicle(thePlayer, veh)  
end 
end) 

Link to comment

#Client :

marker = createMarker(1543.01550,-1719.50916,12.55456,"cylinder",3,255,255,255) 
       
GUIEditor = { 
    button = {}, 
    window = {} 
} 
  
    GUIEditor.window[1] = guiCreateWindow(238, 130, 492, 333, "INRU Spawner", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
    GUIEditor.button[2] = guiCreateButton(386, 24, 96, 55, "Close", false, GUIEditor.window[1]) 
    GUIEditor.button[1] = guiCreateButton(9, 22, 103, 50, "Sanchez", false, GUIEditor.window[1])  
    showCursor ( true )   
  
addEventHandler("onClientMarkerHit", root, 
    function () 
        if ( source == marker ) then 
            guiSetVisible(GUIEditor.window[1], true) 
            showCursor(true) 
            guiSetInputEnabled(true) 
        end 
    end ) 
  
  
  
addEventHandler("onClientGUIClick", root, 
    function () 
        if ( source == GUIEditor.button[2] ) then 
            guiSetVisible(GUIEditor.window[1], false) 
            showCursor(false) 
            guiSetInputEnabled(false) 
        end 
    end ) 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == GUIEditor.button[1]) then 
            local x,y,z = getElementPosition ( localPlayer ) 
            guiSetVisible(GUIEditor.window[1],false) 
            showCursor(false) 
            guiSetInputEnabled(false) 
            triggerServerEvent("spawn:car", localPlayer, x,y,z) 
            veh = createVehicle ( 468, x, y, z + 10 ) 
            warpPedIntoVehicle(thePlayer, veh) 
        end 
    end ) 

#Server :

addEvent("spawn:car", true) 
addEventHandler("spawn:car", root, 
    function (x , y , z) 
        local veh = createVehicle ( 468, x, y, z + 10 ) 
        if ( veh ) then 
            warpPedIntoVehicle(source, veh) 
        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...