Jump to content

طلب فنكشات


EH10

Recommended Posts

الكود صح او خطى صححلي

ok = guiCreateButton( 0, 0, 0, 0, "ok", true ) 
Edits = guiCreateEdit( 0, 0, 0, 0, "", true ) 
  
if (tonumber(guiGetText(Edits)) == nil) then 
guiSetText(Edits, "") 
  
addEventHandler("onClientGUIClick", root, 
   function () 
    if ( source == ok ) then 
    triggerServerEvent("Car", localPlayer) 
     outputChatBox ( "......", source, 255, 255, 255, true ) 
   end 
end 
) 

addEvent("Car", true) 
addEventHandler("Car", root, 
function () 
  if getPlayerSerial ( source ) == "My Serial" then 
  veh = createVehicle ( id, x, y, z ) 
  warpPedIntoVehicle ( source, veh ) 
 end 
) 

Link to comment

ok = guiCreateButton( 0, 0, 0, 0, "ok", true ) 
Edits = guiCreateEdit( 0, 0, 0, 0, "", true ) 
  
addEventHandler("onClientGUIClick", root, 
function () 
 if ( source == ok ) then 
    if (tonumber(guiGetText(Edits)) == nil) then 
       guiSetText(Edits, "") 
       return end 
    triggerServerEvent("Car", localPlayer, guiGetText(Edits)) 
  end 
end 
) 

addEvent("Car", true) 
addEventHandler("Car", root, 
function (id) 
 veh = createVehicle ( id, x, y, z ) 
  warpPedIntoVehicle ( source, veh ) 
 end 
) 
  
addEventHandler("onVehicleStartEnter", veh, 
  function (player) 
    if getPlayerSerial ( player ) == "My Serial" then 
        outputChatBox("Welome Sir", player, 255, 255, 0) 
       else 
      cancelEvent () 
    outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
  end 
end 
) 
Link to comment
حياك الله ^_^

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

الكود #

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
  
function sw()  
    if guiGetVisible ( wnd ) then    
       guiSetVisible ( wnd, false )  
       showCursor(false)   
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( wnd, true ) 
        showCursor(true)  
        guiSetInputEnabled(true) 
    end  
end  
bindKey("F2", "down", sw)  
  
  
addEventHandler("onClientGUIClick", root, 
function () 
 if ( source == ok ) then 
    if (tonumber(guiGetText(Edits)) == nil) then 
       guiSetText(Edits, "") 
       return end 
    triggerServerEvent("Car", localPlayer, guiGetText(Edits)) 
  end 
end 
) 

Link to comment

# ججرب

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
  
bindKey("F2","Down",function() 
    if ( guiGetVisible(wnd) == true ) then 
        guiSetVisible(wnd, false); 
        showCursor( false ); 
        guiSetInputEnabled( false ); 
    else 
        guiSetVisible(wnd, true); 
        showCursor( true ); 
        guiSetInputEnabled( true ); 
    end 
end) 
  
  
addEventHandler("onClientGUIClick", root, function ( ) 
 if ( source == ok ) then 
    local ZA7F = guiGetText( Edits ) 
     if ( ZA7F and string.len( ZA7F ) == 3 ) then 
        if ( ZA7F and tonumber ( ZA7F ) ) then 
           triggerServerEvent("Car", localPlayer, guiGetText(Edits)) 
                  end 
              end 
         end 
     end 
) 
Link to comment
# ججرب

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
  
bindKey("F2","Down",function() 
    if ( guiGetVisible(wnd) == true ) then 
        guiSetVisible(wnd, false); 
        showCursor( false ); 
        guiSetInputEnabled( false ); 
    else 
        guiSetVisible(wnd, true); 
        showCursor( true ); 
        guiSetInputEnabled( true ); 
    end 
end) 
  
  
addEventHandler("onClientGUIClick", root, function ( ) 
 if ( source == ok ) then 
    local ZA7F = guiGetText( Edits ) 
     if ( ZA7F and string.len( ZA7F ) == 3 ) then 
        if ( ZA7F and tonumber ( ZA7F ) ) then 
           triggerServerEvent("Car", localPlayer, guiGetText(Edits)) 
                  end 
              end 
         end 
     end 
) 

الوحة تفتح وكل شي بس لما اكتب بالايديت رقم السياره واضغط الزر ماتجي السياره

الاكواد

# Client Side 
wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
  
bindKey("F2","Down",function() 
    if ( guiGetVisible(wnd) == true ) then 
        guiSetVisible(wnd, false); 
        showCursor( false ); 
        guiSetInputEnabled( false ); 
    else 
        guiSetVisible(wnd, true); 
        showCursor( true ); 
        guiSetInputEnabled( true ); 
    end 
end) 
  
  
addEventHandler("onClientGUIClick", root, function ( ) 
 if ( source == ok ) then 
    local ZA7F = guiGetText( Edits ) 
     if ( ZA7F and string.len( ZA7F ) == 3 ) then 
        if ( ZA7F and tonumber ( ZA7F ) ) then 
           triggerServerEvent("Car", localPlayer, guiGetText(Edits)) 
                  end 
              end 
         end 
     end 
) 

# Server Side 
addEvent("Car", true) 
addEventHandler("Car", root, 
function (id) 
 veh = createVehicle ( id, x, y, z ) 
  warpPedIntoVehicle ( source, veh ) 
 end 
) 
  
addEventHandler("onVehicleStartEnter", veh, 
  function (player) 
    if getPlayerSerial ( player ) == ">>>>>>>>>>>>>" then 
        outputChatBox("Welome Sir", player, 255, 255, 0) 
       else 
      cancelEvent () 
    outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
  end 
end 
) 

Link to comment
  
# Client Side 
wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
  
bindKey("F2","Down",function() 
        local vis = not guiGetVisible(wnd) 
        guiSetVisible(wnd, vis); 
        showCursor( vis ); 
        guiSetInputEnabled( vis ); 
    end 
) 
  
addEventHandler("onClientGUIClick", root,  
    function ( ) 
        if ( source == ok ) then 
            local ZA7F = guiGetText( Edits ) 
            if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then 
                triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
            end  
        end 
    end 
) 
  
  

  
# Server Side 
addEvent("Car", true) 
addEventHandler("Car", root, 
    function () 
        local x,y,z= getElementPosition(source) 
        veh = createVehicle ( id, x, y, z ) 
        warpPedIntoVehicle ( source, veh ) 
    end 
) 
  
addEventHandler("onVehicleStartEnter", resourceRoot, 
    function (player) 
        if getPlayerSerial ( player ) == "سيريالك" then 
            outputChatBox("Welome Sir", player, 255, 255, 0) 
        else 
            cancelEvent () 
            outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
        end 
    end 
) 
  

Link to comment
  
# Client Side 
wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
  
bindKey("F2","Down",function() 
        local vis = not guiGetVisible(wnd) 
        guiSetVisible(wnd, vis); 
        showCursor( vis ); 
        guiSetInputEnabled( vis ); 
    end 
) 
  
addEventHandler("onClientGUIClick", root,  
    function ( ) 
        if ( source == ok ) then 
            local ZA7F = guiGetText( Edits ) 
            if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then 
                triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
            end  
        end 
    end 
) 
  
  

  
# Server Side 
addEvent("Car", true) 
addEventHandler("Car", root, 
    function () 
        local x,y,z= getElementPosition(source) 
        veh = createVehicle ( id, x, y, z ) 
        warpPedIntoVehicle ( source, veh ) 
    end 
) 
  
addEventHandler("onVehicleStartEnter", resourceRoot, 
    function (player) 
        if getPlayerSerial ( player ) == "سيريالك" then 
            outputChatBox("Welome Sir", player, 255, 255, 0) 
        else 
            cancelEvent () 
            outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
        end 
    end 
) 
  

الوحة ماتفتح

Link to comment

جرب

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
      
bindKey ( "F2" , "down" , function() 
    guiSetVisible(wnd,not guiGetVisible(wnd)) 
    showCursor(not isCursorShowing()) 
    end 
) 
      
    addEventHandler("onClientGUIClick", root, 
        function ( ) 
            if ( source == ok ) then 
                local ZA7F = guiGetText( Edits ) 
                if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then 
                    triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
                end  
            end 
        end 
    ) 
      
      

      
    # Server Side 
    addEvent("Car", true) 
    addEventHandler("Car", root, 
        function (id) 
            local x,y,z= getElementPosition(source) 
            veh = createVehicle ( id, x, y, z ) 
            warpPedIntoVehicle ( source, veh ) 
        end 
    ) 
      
    addEventHandler("onVehicleStartEnter", resourceRoot, 
        function (player) 
            if getPlayerSerial ( player ) == "سيريالك" then 
                outputChatBox("Welcome Sir", player, 255, 255, 0) 
            else 
                cancelEvent () 
                outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
            end 
        end 
    ) 
      
Link to comment
جرب

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
      
bindKey ( "F2" , "down" , function() 
    guiSetVisible(wnd,not guiGetVisible(wnd)) 
    showCursor(not isCursorShowing()) 
    end 
) 
      
    addEventHandler("onClientGUIClick", root, 
        function ( ) 
            if ( source == ok ) then 
                local ZA7F = guiGetText( Edits ) 
                if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then 
                    triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
                end  
            end 
        end 
    ) 
      
      

      
    # Server Side 
    addEvent("Car", true) 
    addEventHandler("Car", root, 
        function (id) 
            local x,y,z= getElementPosition(source) 
            veh = createVehicle ( id, x, y, z ) 
            warpPedIntoVehicle ( source, veh ) 
        end 
    ) 
      
    addEventHandler("onVehicleStartEnter", resourceRoot, 
        function (player) 
            if getPlayerSerial ( player ) == "سيريالك" then 
                outputChatBox("Welcome Sir", player, 255, 255, 0) 
            else 
                cancelEvent () 
                outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
            end 
        end 
    ) 
      

ماشتغلت الوحة

Link to comment

# ججرب , لو ما اشتغل المشكلة من عندك ...

Client Side !

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
      
bindKey ( "F2", "down", function( ) 
    guiSetVisible(wnd, not guiGetVisible( wnd )); 
    showCursor( guiGetVisible( wnd ) ); 
end ) 
      
addEventHandler("onClientGUIClick", root, function ( ) 
   if ( source == ok ) then 
       local ZA7F = guiGetText( Edits ) 
        if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then 
                triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
            end  
        end 
    end 
) 

Server Side !

addEvent("Car", true) 
addEventHandler("Car", root, 
    function (id) 
        local x, y, z = getElementPosition(source) 
        vehicle = createVehicle ( id, x+ 3, y, z ) 
        if vehicle then 
        warpPedIntoVehicle ( source, vehicle ) 
        end 
   end 
) 
  
addEventHandler("onVehicleStartEnter", vehicle, 
    function ( player ) 
        if getPlayerSerial ( player ) == "سيريالك" then 
            outputChatBox("Welome Sir", player, 255, 255, 0) 
        else 
            cancelEvent () 
            outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
        end 
    end 
) 
Link to comment
# ججرب , لو ما اشتغل المشكلة من عندك ...

Client Side !

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
      
bindKey ( "F2", "down", function( ) 
    guiSetVisible(wnd, not guiGetVisible( wnd )); 
    showCursor( guiGetVisible( wnd ) ); 
end ) 
      
addEventHandler("onClientGUIClick", root, function ( ) 
   if ( source == ok ) then 
       local ZA7F = guiGetText( Edits ) 
        if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then 
                triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
            end  
        end 
    end 
) 

Server Side !

addEvent("Car", true) 
addEventHandler("Car", root, 
    function (id) 
        local x, y, z = getElementPosition(source) 
        vehicle = createVehicle ( id, x+ 3, y, z ) 
        if vehicle then 
        warpPedIntoVehicle ( source, vehicle ) 
        end 
   end 
) 
  
addEventHandler("onVehicleStartEnter", vehicle, 
    function ( player ) 
        if getPlayerSerial ( player ) == "سيريالك" then 
            outputChatBox("Welome Sir", player, 255, 255, 0) 
        else 
            cancelEvent () 
            outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
        end 
    end 
) 

اشتغل وضبط

بس انا ابي

وابي اذا طلع سياره وبعدين طلع سياره ثانية تختفي السياره الاولى

اسف اذا كثرت طلباتي

Link to comment

Client Side !

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
      
bindKey ( "F2", "down", function( ) 
    local vis = not guiGetVisible( wnd ) 
    guiSetVisible(wnd, vis); 
    showCursor(vis); 
end ) 
      
addEventHandler("onClientGUIClick", root, function ( ) 
  if ( source == ok ) then 
       local ZA7F = guiGetText( Edits ) 
        if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then 
               triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
            end  
        end 
    end 
) 

Server Side !

  
local vehicle = {} 
addEvent("Car", true) 
addEventHandler("Car", root, 
    function (id) 
        local x, y, z = getElementPosition(source) 
        if vehicle[source] then  
            if isElement( vehicle[source] ) then  
                destroyElement(vehicle[source])  
            end  
            vehicle[source] = nil  
        end      
        vehicle[source] = createVehicle ( id, x + 3, y, z ) 
        if vehicle[source] then 
            warpPedIntoVehicle ( source, vehicle[source] ) 
        end 
   end 
) 
  
addEventHandler("onVehicleStartEnter", resourceRoot, 
    function ( player ) 
        if getPlayerSerial ( player ) == "سيريالك" then 
            outputChatBox("Welome Sir", player, 255, 255, 0) 
        else 
            cancelEvent () 
            outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
        end 
    end 
) 
  
addEventHandler("onPlayerQuit",root,function() 
    if vehicle[source] then  
        if isElement( vehicle[source] ) then  
            destroyElement(vehicle[source])  
        end  
        vehicle[source] = nil  
    end 
end) 
  
  

Link to comment
Client Side !

wnd = guiCreateWindow(237,154,382,294,"",false) 
Edits = guiCreateEdit(116,54,120,36,"",false,wnd) 
ok = guiCreateButton(105,114,148,31,"",false,wnd) 
guiSetVisible(wnd, false) 
      
bindKey ( "F2", "down", function( ) 
  
    guiSetVisible(wnd, not guiGetVisible( wnd )); 
    showCursor( guiGetVisible( wnd ) ); 
end ) 
      
addEventHandler("onClientGUIClick", root, function ( ) 
   if ( source == ok ) then 
       local ZA7F = guiGetText( Edits ) 
        if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then 
                triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) 
            end  
        end 
    end 
) 

Server Side !

  
local vehicle = {} 
addEvent("Car", true) 
addEventHandler("Car", root, 
    function (id) 
        local x, y, z = getElementPosition(source) 
        if vehicle[source] then  
            if isElement( vehicle[source] ) then  
                destroyElement(vehicle[source])  
            end  
            vehicle[source] = nil  
        end      
        vehicle[source] = createVehicle ( id, x + 3, y, z ) 
        if vehicle[source] then 
            warpPedIntoVehicle ( source, vehicle[source] ) 
        end 
   end 
) 
  
addEventHandler("onVehicleStartEnter", resourceRoot, 
    function ( player ) 
        if getPlayerSerial ( player ) == "سيريالك" then 
            outputChatBox("Welome Sir", player, 255, 255, 0) 
        else 
            cancelEvent () 
            outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) 
        end 
    end 
) 
  
addEventHandler("onPlayerQuit",root,function() 
    if vehicle[source] then  
        if isElement( vehicle[source] ) then  
            destroyElement(vehicle[source])  
        end  
        vehicle[source] = nil  
    end 
end) 
  
  

شكرا لك

بس اذا ماتعبتك معي ابي شغلة

اذا واحد خذ سياره تتسجل بسريالة وماحد يركبها غيره هو واي واحد يركبها يقول السياره ملك ويجي اسمة

واذا ركب السياره ابو طيف يقول منور سيارتك ويجي اسمة

Link to comment

#Server side!

  
local vehicle = {} 
addEvent("Car", true) 
addEventHandler("Car", root, 
    function (id) 
        local x, y, z = getElementPosition(source) 
        if vehicle[source] then 
            if isElement( vehicle[source] ) then 
                destroyElement(vehicle[source]) 
            end 
            vehicle[source] = nil 
        end     
        vehicle[source] = createVehicle ( id, x + 3, y, z ) 
        if vehicle[source] then 
            warpPedIntoVehicle ( source, vehicle[source] ) 
        end 
        setElementData(vehicle[source],'carData',{getPlayerSerial(source),getPlayerName(source)}) 
   end 
) 
  
addEventHandler("onVehicleStartEnter", resourceRoot, 
    function ( player ) 
        local serial = getElementData(source,'carData')  
        if serial and serial[1] and serial[2] and getPlayerSerial ( player ) == serial[1] then 
            outputChatBox(" منور سيارتك [".. serial[2] or '' ..']', player, math.random(0,255), math.random(0,255), math.random(0,255), true ) 
        else 
            cancelEvent () 
            outputChatBox ( "* This not your car this is :[ " .. serial[2] or '' .. " ] s car", player, math.random(0,255), math.random(0,255), math.random(0,255), true ) 
        end 
    end 
) 
  
addEventHandler("onPlayerQuit",root,function() 
    if vehicle[source] then 
        if isElement( vehicle[source] ) then 
            destroyElement(vehicle[source]) 
        end 
        vehicle[source] = nil 
    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...