Jump to content

ÆBKV

Members
  • Posts

    64
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ÆBKV

  1. addEventHandler("onClientGUIClick",root, function() if source == spawnScreenOKButton then guiSetVisible(spawnScreenMenu,false) showCursor(false) end end )
  2. Last question, Is it possible to search the first letter of the vehicle? For example, if I search for "A" then all vehicles with the first letter "A" are in the gridlist. Right now it's like this if I search for "A" then there are L(a)ndstalker, Br(a)vura etc. in the gridlist
  3. string.find(string.upper(getVehicleNameFromModel(v[1])),string.upper(guiGetText(v_editbox))) But why is it the same with string.upper?
  4. string.find(string.lower(getVehicleNameFromModel(v[1])),string.lower(guiGetText(v_editbox))) Like this?
  5. it does not work so well with small and capital letters, do you have an idea why?
  6. Thank you very much bro, I've tried it with onClientGUIChange and it's much better!
  7. -- CLIENT -- vehicles = {{400},{401},{402},{403},{404},{405},{406},{407},{408},{409},{410}, {411},{412},{413},{414},{415},{416},{417},{418},{419},{420},{421},{422},{423}, {424},{425},{426},{427},{428},{429},{430},{431},{432},{433},{434},{435},{436}, {437},{438},{439},{440},{441},{442},{443},{444},{445},{446},{447},{448},{449}, {450},{451},{452},{453},{454},{455},{456},{457},{458},{459},{460},{461},{462}, {463},{464},{465},{466},{467},{468},{469},{470},{471},{472},{473},{474},{475}, {476},{477},{478},{479},{480},{481},{482},{483},{484},{485},{486},{487},{488}, {489},{490},{491},{492},{493},{494},{495},{496},{497},{498},{499},{500},{501}, {502},{503},{504},{505},{506},{507},{508},{509},{510},{511},{512},{513},{514}, {515},{516},{517},{518},{519},{520},{521},{522},{523},{524},{525},{526},{527}, {528},{529},{530},{531},{532},{533},{534},{535},{536},{537},{538},{539},{540}, {541},{542},{543},{544},{545},{546},{547},{548},{549},{550},{551},{552},{553}, {554},{555},{556},{557},{558},{559},{560},{561},{562},{563},{564},{565},{566}, {567},{568},{569},{570},{571},{572},{573},{574},{575},{576},{577},{578},{579}, {580},{581},{582},{583},{584},{585},{586},{587},{588},{589},{590},{591},{592}, {593},{594},{595},{596},{597},{598},{599},{600},{601},{602},{603},{604},{605}, {606},{607},{608},{609},{610},{611}} local screenW,screenH = guiGetScreenSize() window = guiCreateWindow((screenW-600)/2,(screenH-500)/2,600,500,"Panel",false) tabpanel = guiCreateTabPanel(10,30,580,460,false,window) v_tab = guiCreateTab("Vehicles",tabpanel) v_gridlist = guiCreateGridList(10,45,560,341,false,v_tab) v_editbox = guiCreateEdit(10,10,150,30,"",false,v_tab) v_button1 = guiCreateButton(420,396,150,30,"Create",false,v_tab) v_button2 = guiCreateButton(10,396,150,30,"Close",false,v_tab) v_button3 = guiCreateButton(170,10,80,30,"Search",false,v_tab) guiSetVisible(window,false) guiWindowSetSizable(window,false) guiGridListAddColumn(v_gridlist,"Vehicle",1.0) guiSetProperty(v_gridlist,"ColumnsSizable","False") guiSetProperty(v_gridlist,"SortSettingEnabled","False") for _,vehicle in ipairs(vehicles) do local vehicleName = getVehicleNameFromModel(vehicle[1]) local v_row = guiGridListAddRow(v_gridlist) guiGridListSetItemText(v_gridlist,v_row,1,vehicleName,false,false) end addEventHandler("onClientGUIClick",root, function() if source == v_button1 and guiGridListGetSelectedItem(v_gridlist) >= 0 then local getVehicle = guiGridListGetItemText(v_gridlist,guiGridListGetSelectedItem(v_gridlist),1) local vehicleID = getVehicleModelFromName(getVehicle) triggerServerEvent("createVehicle",localPlayer,vehicleID) elseif source == v_button2 then guiSetVisible(window,false) showCursor(false) end end ) bindKey("F2","down", function() if guiGetVisible(window) == false then guiSetVisible(window,true) showCursor(true) else guiSetVisible(window,false) showCursor(false) end end ) -- SERVER -- addEvent("createVehicle",true) addEventHandler("createVehicle",root, function(vehicleID) local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) local vehicle = createVehicle(vehicleID,x,y,z,rx,ry,rz) warpPedIntoVehicle(source,vehicle) end ) Hello guys, how can I search for vehicles from the gridlist? I have created an editbox for the vehicle name (v_editbox) and a button to search for the vehicle (v_button3). So if I search for, for example, "Infernus" and press the search button is only Infernus in the gridlist. Can someone help me please?
  8. -- not the whole code -- vehicles = {{411},{451},{506}} v_editbox = guiCreateEdit(10,10,150,30,"Search",false,v_tab) for _,vehicle in ipairs(vehicles) do local vehicleName = getVehicleNameFromID(weapon[1]) local w_row = guiGridListAddRow(w_gridlist) guiGridListSetItemText(w_gridlist,w_row,1,weaponName,false,false) end Hello guys, how can I search for vehicles from the Grid List? I have specially created an editbox where the players can search for vehicles. (v_editbox) In the table I created are the vehicles Infernus, Turismo and Super GT. So if I write in, for example, "Infernus", is only Infernus in the Grid List. Can someone help me please?
  9. That helped me a lot guys, thank you.
  10. Please explain me why "tonumber" when it is already a number?
  11. weapon = { {"Brass Knuckles","1"} } getWeapon = -- How can i get the weapon id from the table?? Thank you, can you help me here too?
  12. How can I check if the player has selected an item? addEventHandler("onClientGUIClick",root, function() if source == button1 then getWeapon = guiGridListGetItemText(gridlist1,guiGridListGetSelectedItem(gridlist1),2) getAmmo = guiGetText(editbox1) triggerServerEvent("giveWeapon",localPlayer,getWeapon,getAmmo) end end )
×
×
  • Create New...