Jump to content

مشاكل القريد ليست


Recommended Posts

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

انا سويت قرد ليست اقصد قريد ليست

المهم...

وظيفه القريد ليست سويت رو وكولمن

وحطيت لما اضغط يجيني سياره وسويت ترايقر وكل شي

كل شي تمام والحمد لله بس

بس المشكلة

اني لما اضغط على القريد ليست نفسه

يعطيني سياره ابي بس لما اضغط على الرو

بس ما عرفت وجربت نزلت مودات السيارات من الكومنتي

وما استفدت منها شي

--الاكواد

كلينت

  
GUIEditor = { 
    gridlist = {}, 
    window = {} 
} 
  
GUIEditor.window[1] = guiCreateWindow(258, 194, 405, 339, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 22, 204, 307, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "السيارة", 0.5) 
guiGridListAddColumn(GUIEditor.gridlist[1], "$", 0.5) 
  
  
  
guiGridListAddRow (GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "صغيرة", false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "10000", false, false) 
  
------ 
guiSetVisible (GUIEditor.window[1], false) 
bindKey ('F3', 'down',function () 
     if (guiGetVisible(GUIEditor.window[1]) == false) then 
    guiSetVisible (GUIEditor.window[1], true) 
    showCursor (true) 
  elseif (guiGetVisible(GUIEditor.window[1]) == true) then 
    guiSetVisible (GUIEditor.window[1], false) 
    showCursor (false) 
  end 
end) 
---------- 
     
addEventHandler ("onClientGUIDoubleClick", root, 
    function () 
      
        if ( source == GUIEditor.gridlist[1] ) then 
     triggerServerEvent("Trigger", localPlayer) 
  end 
end 
 ) 
  
  
  
  
  

سيرفر

  
addEvent("Trigger",true)  
addEventHandler("Trigger",root,  
function () 
  
 x, y, z = getElementPosition ( source ) 
      createVehicle ( 434, x + 10, y, z )  
      end 
      ) 

اغلب السكربتات

ومثال من الويكي كذا يسون

  for key,weaponName in pairs(shotguns) do 
                local row = guiGridListAddRow ( spawnScreenGridList ) 
  

باختصار يسوون

local

بس انا سويت لوكال

وما زبطط :cry::cry:

Link to comment
addEventHandler ("onClientGUIDoubleClick", root, 
    function () 
      
        if ( source == GUIEditor.gridlist[1] ) then 
             local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) 
    if ( row == -1 ) then return end 
     triggerServerEvent("Trigger", localPlayer) 
  end 
end 
 ) 

جرب ذا

Link to comment

Client Side :

local car = { 
{"Banshee"}; 
--{"Car Name"}; 
} 
  
  
GUIEditor = { 
    gridlist = {}, 
    window = {} 
} 
  
GUIEditor.window[1] = guiCreateWindow(258, 194, 405, 339, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 22, 204, 307, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "السيارة", 0.5) 
  
  
  
  
function onStart() 
  for i, v in ipairs (car) do 
  row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
   guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v[1], false, false ) 
  end 
end 
addEventHandler("onClientResourceStart", resourceRoot, onStart ) 
  
addEventHandler("onClientGUIDoubleClick", GUIEditor.gridlist[1], 
 function () 
  local Roww, column = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )   
    if Roww and column and Roww ~= -1 and column ~= -1 then 
        local carid = guiGridListSetItemText ( GUIEditor.gridlist[1], Roww, column  ) 
            local carsID = getVehicleModelFromName ( carid ) 
        triggerServerEvent( "buyCar", localPlayer, carsID ) 
    end 
  end 
) 
  
bindKey("F3","down", function() 
guiSetVisible ( GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) 
showCursor ( guiGetVisible (GUIEditor.window[1]) ) 
end ) 

Server Side :

local car = {} 
  
addEvent("buyCar",true) 
addEventHandler("buyCar",root, 
function (id) 
    if isElement(car[source]) then destroyElement(car[source]) end 
            local x, y, z = getElementPosition ( source ) 
        car[source] = createVehicle ( id, x + 10, y, z ) 
    end 
) 
  
  
addEventHandler("onVehicleExplode",root,function() 
setTimer(destroyElement,2000,1,source) 
end) 
  
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if car[source] then 
            if isElement ( car[source] ) then 
                destroyElement(car[source]) 
            end 
            car[source] = nil 
        end  
    end 
) 
Edited by Guest
Link to comment

جرب

Client Side

  
local car = { 
{"banshee"}; 
--{"Car Name"}; 
} 
  
  
GUIEditor = { 
    gridlist = {}, 
    window = {} 
} 
  
GUIEditor.window[1] = guiCreateWindow(258, 194, 405, 339, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 22, 204, 307, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "السيارة", 0.5) 
  
  
  
  
function onStart() 
  for i, v in ipairs (car) do 
  row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
   guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v[1], false, false ) 
  end 
end 
addEventHandler("onClientResourceStart", resourceRoot, onStart ) 
  
addEventHandler("onClientGUIDoubleClick", GUIEditor.gridlist[1], 
 function () 
  local Row = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )   
    if (Row ~= -1) then 
        local carName = guiGridListGetItemText ( GUIEditor.gridlist[1], Row, 1  ) 
        triggerServerEvent( "buyCar", localPlayer, carName ) 
    end 
  end 
) 
  
bindKey("F3","down", function() 
guiSetVisible ( GUIEditor.window[1], not guiGetVisible (GUIEditor.window[1]) ) 
showCursor ( guiGetVisible (GUIEditor.window[1]) ) 
end) 
  

Server Side

  
local car = {} 
  
addEvent("buyCar",true) 
addEventHandler("buyCar",root, 
function (name) 
    if isElement(car[source]) then destroyElement(car[source]) end 
            local x, y, z = getElementPosition ( source ) 
        car[source] = createVehicle ( getVehicleModelFromName(name), x + 10, y, z ) 
    end 
) 
  
  
addEventHandler("onVehicleExplode",root,function() 
setTimer(destroyElement,2000,1,source) 
end) 
  
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if car[source] then 
            if isElement ( car[source] ) then 
                destroyElement(car[source]) 
            end 
            car[source] = nil 
        end 
    end 
) 
  

Edited by Guest
Link to comment

شكرا حسين اشتغل الكود :D

بالنسبة

warpPedIntoVehicle

خلاص سويتها

بس فيه اشياء ما فهمتها يا ريت تشرح لي اياها

عشان ما اطلب مره ثانيه

addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if car[source] then -- وهذذي كمان اش فايدتها ومن وين جبتها  
            if isElement ( car[source] ) then -- ؟؟ 
                destroyElement(car[source]) 
            end 
            car[source] = nil -- هذي مافهمت وش معناها  
        end 
    end 
) 

for i, v in ipairs (car) do -- i,v وش تسوي ذي  

local Row = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] )   
    if (Row ~= -1) then 

وشرح لهذي الي فوق

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