HustraDev Posted August 16, 2014 Posted August 16, 2014 Hello World, i think the most Database Language Used in Script's The SQLite So i'm Thinking to use it in New Script ShowCar , with Spawn And Destroy So i need some function and Event's To use it Can anyone give it to me ? Thanks ~
HustraDev Posted August 16, 2014 Author Posted August 16, 2014 executeSQLQuery ok but How to Create The database file the function you give it to me Create TABLE and colname and How to add colname to gridlist in GUI and Thanks So fast reply
Saml1er Posted August 16, 2014 Posted August 16, 2014 It will be better for you to google it. I'm on phone so I can't write lua code so I copied a code from aibo's post and made some changes. -- server: addEvent("IneedMaps", true) addEventHandler("IneedMaps", getRootElement(), function (player) local mapTable = {} for i, map in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getResourceFromName("race"))) do table.insert(mapTable, getResourceInfo(map, "name")) -- this will add map to list by MAP NAME --table.insert(mapTable, getResourceName(map)) -- this will add map by its RESOURCE NAME end triggerClientEvent(player, "mapListUpdate", getRootElement(), mapTable) end) -- client: setTimer(function()triggerServerEvent ("IneedMaps",localPlayer) end,2000,1) local list = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true) local column = guiGridListAddColumn( list, "Player", 0.85 ) addEvent("mapListUpdate", true) addEventHandler("mapListUpdate", getRootElement(), function(maps) guiGridListClear(list) for i, map in ipairs(maps) do local row = guiGridListAddRow(list) guiGridListSetItemText(list, row, column, map, false, false) end end)
HustraDev Posted August 16, 2014 Author Posted August 16, 2014 It will be better for you to google it. I'm on phone so I can't write lua code so I copied a code from aibo's post and made some changes. -- server: addEvent("IneedMaps", true) addEventHandler("IneedMaps", getRootElement(), function (player) local mapTable = {} for i, map in ipairs(exports.mapmanager:getMapsCompatibleWithGamemode(getResourceFromName("race"))) do table.insert(mapTable, getResourceInfo(map, "name")) -- this will add map to list by MAP NAME --table.insert(mapTable, getResourceName(map)) -- this will add map by its RESOURCE NAME end triggerClientEvent(player, "mapListUpdate", getRootElement(), mapTable) end) -- client: setTimer(function()triggerServerEvent ("IneedMaps",localPlayer) end,2000,1) local list = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true) local column = guiGridListAddColumn( list, "Player", 0.85 ) addEvent("mapListUpdate", true) addEventHandler("mapListUpdate", getRootElement(), function(maps) guiGridListClear(list) for i, map in ipairs(maps) do local row = guiGridListAddRow(list) guiGridListSetItemText(list, row, column, map, false, false) end end) Thanks Man Finally i Get it
Saml1er Posted August 16, 2014 Posted August 16, 2014 Also check this out: viewtopic.php?f=148&t=38203
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now