-- server --
function sendRowsToClient()
local result = dbPoll(dbQuery( connection, "SELECT * FROM `VList`", -1))
if result and type( result ) == 'table' then
for i, v in ipairs(result) do
triggerClientEvent(source, "onClientDataReceived", source, v.id, v.name, v.price)
end
end
end
-- client --
addEvent("onClientDataReceived", true)
addEventHandler("onClientDataReceived", root,
function(sID,sName,sPrice)
local row = guiGridListAddRow ( PlayerVehicleList )
guiGridListSetItemText ( PlayerVehicleList, row, 1, sID, false, false )
guiGridListSetItemText ( PlayerVehicleList, row, 2, sName, false, false )
guiGridListSetItemText ( PlayerVehicleList, row, 3, sPrice, false, false )
end
)
Try this, not tested