Jump to content

تعديل


Recommended Posts

وش الغلط؟

  
 FontGrid = guiCreateFont( "Font.ttf", 10 )  
  
 FontSearch = guiCreateFont( "Font.ttf", 10 )  
  
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 
  
--alamaken = { 
                   {"Int",-3577.685546875, -2433.1162109375, 13.7849817276}, 
} 
  
  
  
  
GUIEditor = { 
    label = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFFF") 
  
grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1]) 
guiGridListAddColumn(grid, "Positions", 0.9) 
edit = guiCreateEdit(9, 25, 261, 24, "", false, GUIEditor.window[1]) 
guiSetFont(edit,FontSearch) 
move = guiCreateButton(53, 335, 166, 29, "", false, GUIEditor.window[1]) 
label = guiCreateLabel(209, 366, 85, 24, "", false, GUIEditor.window[1]) 
guiLabelSetColor(label, 255, 0, 0)    
  
addEventHandler ("onClientGUIClick", root, 
        function() 
        if (source == ff) then 
         guiSetVisible(GUIEditor.window[1], false) 
         showCursor(false) 
         guiSetInputEnabled(false) 
        end 
    end 
) 
------------------------------------------------------------------ 
  
function loadalamaken ( ) 
guiGridListClear(grid) 
for i,ha in ipairs(alamaken) do 
 local row = guiGridListAddRow(grid) 
    local row = guiGridListAddRow(grid) 
    guiGridListSetItemText(grid,row,1,ha[1],false,false) 
    guiGridListSetItemData(grid,row,1,ha[94],ha[3],ha[4]}) 
    guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
 end 
end 
  
addEventHandler("onClientGUIChanged",root, 
function () 
if ( source == edit ) then  
local text = guiGetText(edit) 
if ( text == "" ) then 
loadalamaken ( ) 
 else 
guiGridListClear(grid) 
for i,v in ipairs(alamaken) do 
local name = tostring(v[1]) 
 if string.find(string.upper(name),string.upper(guiGetText(edit))) then 
local row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid,row,1,name,false,false) 
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
                    end 
                end 
            end 
        end 
    end 
) 
  
  
  
guiSetVisible(GUIEditor.window[1],false) 
  
bindKey("f6","down", 
    function () 
        if guiGetVisible(GUIEditor.window[1]) then 
            guiSetVisible(GUIEditor.window[1],false) 
            showCursor(false) 
            guiSetInputEnabled(false) 
        else 
              if (getElementDimension(localPlayer) == 30) then return end 
            guiSetVisible(GUIEditor.window[1],true) 
            showCursor(true) 
            guiSetInputEnabled(true) 
            putInfo() 
            putPlayers() 
        end 
    end 
) 
for i,v in ipairs(alamaken) do 
 local row = guiGridListAddRow(grid) 
 guiGridListSetItemText(grid,row,1,v[1],false,false) 
 guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) 
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
                local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
                if theVehicle then 
            else 
                outputChatBox("* من فضلك اختار مكان للانقال اليه",255,0,0) 
            end 
        end 
    end 
) 
  
addEventHandler("onClientGUIDoubleClick",root,function() 
if ( source == grid ) then 
local sel = guiGridListGetSelectedItem(grid) 
if sel ~= -1 then 
    local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
    setElementPosition(localPlayer,x,y,z) 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
end 
end 
end) 
  
deleteFile("client.lua") 
  

Link to comment
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if  isPedInVehicle(localPlayer)  then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
            else 
                outputChatBox("يجب عليك ان تركب في سياره",255,0,0) 
            end 
        ) 

Link to comment
addEventHandler("onClientGUIClick", resourceRoot, function() 
    local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
            local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
            if isPedInVehicle(localPlayer) and getPedOccupiedVehicle (localPlayer) then 
                setElementPosition(getPedOccupiedVehicle(localPlayer),x,y,z) 
            else 
                setElementPosition(localPlayer,x,y,z) 
            end 
        else 
            outputChatBox("* من فضلك اختار مكان للانقال اليه",255,0,0) 
        end 
    end 
end) 

Link to comment
 FontGrid = guiCreateFont( "Font.ttf", 10 ) 
  
 FontSearch = guiCreateFont( "Font.ttf", 10 ) 
  
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 
  
alamaken = { 
                   {"Int",-3577.685546875, -2433.1162109375, 13.7849817276}, 
} 
  
  
  
  
GUIEditor = { 
    label = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFFF") 
  
grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1]) 
guiGridListAddColumn(grid, "Positions", 0.9) 
edit = guiCreateEdit(9, 25, 261, 24, "", false, GUIEditor.window[1]) 
guiSetFont(edit,FontSearch) 
move = guiCreateButton(53, 335, 166, 29, "", false, GUIEditor.window[1]) 
label = guiCreateLabel(209, 366, 85, 24, "", false, GUIEditor.window[1]) 
guiLabelSetColor(label, 255, 0, 0)   
  
addEventHandler ("onClientGUIClick", root, 
        function() 
        if (source == ff) then 
         guiSetVisible(GUIEditor.window[1], false) 
         showCursor(false) 
         guiSetInputEnabled(false) 
        end 
    end 
) 
------------------------------------------------------------------ 
  
function loadalamaken ( ) 
guiGridListClear(grid) 
for i,ha in ipairs(alamaken) do 
 local row = guiGridListAddRow(grid) 
    local row = guiGridListAddRow(grid) 
    guiGridListSetItemText(grid,row,1,ha[1],false,false) 
    guiGridListSetItemData(grid,row,1,{ha[2],ha[3],ha[4]}) 
    guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
 end 
end 
  
addEventHandler("onClientGUIChanged",root, 
function () 
if ( source == edit ) then 
local text = guiGetText(edit) 
if ( text == "" ) then 
loadalamaken ( ) 
 else 
guiGridListClear(grid) 
for i,v in ipairs(alamaken) do 
local name = tostring(v[1]) 
 if string.find(string.upper(name),string.upper(guiGetText(edit))) then 
local row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid,row,1,name,false,false) 
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
                    end 
                end 
            end 
        end 
    end 
) 
  
  
  
guiSetVisible(GUIEditor.window[1],false) 
  
bindKey("f6","down", 
    function () 
        if guiGetVisible(GUIEditor.window[1]) then 
            guiSetVisible(GUIEditor.window[1],false) 
            showCursor(false) 
            guiSetInputEnabled(false) 
        else 
              if (getElementDimension(localPlayer) == 30) then return end 
            guiSetVisible(GUIEditor.window[1],true) 
            showCursor(true) 
            guiSetInputEnabled(true) 
            putInfo() 
            putPlayers() 
    end 
    end 
) 
  
for i,v in ipairs(alamaken) do 
 local row = guiGridListAddRow(grid) 
 guiGridListSetItemText(grid,row,1,v[1],false,false) 
 guiGridListSetItemData(grid,row,1,{v[2],v[3],v[4]}) 
guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
            if ( getPedOccupiedVehicle ( localPlayer ) ) then  
            setElementPosition ( getPedOccupiedVehicle ( localPlayer ) , x , y , z )  
            else 
            setElementPosition ( localPlayer , x , y , z ) 
            end 
            else 
                outputChatBox("* من فضلك اختار مكان للانقال اليه",255,0,0) 
            end 
        end 
    end 
) 
  
addEventHandler("onClientGUIDoubleClick",root,function() 
if ( source == grid ) then 
local sel = guiGridListGetSelectedItem(grid) 
if sel ~= -1 then 
    local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                if ( getPedOccupiedVehicle ( localPlayer ) ) then  
            setElementPosition ( getPedOccupiedVehicle ( localPlayer ) , x , y , z )  
            else 
            setElementPosition ( localPlayer , x , y , z ) 
            end 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
end 
end 
end) 
  
fileDelete("client.lua") 
  

Link to comment
م يشتغل + انا ابي اضيف الخاصيتين مب سياره فقط ابيه يقدر ينتقل بالسياره ولاعب
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if  isPedInVehicle(localPlayer)  then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
            else 
                outputChatBox("يجب عليك ان تركب في سياره",255,0,0) 
            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...