how i can make the spawner cars with key Help me please
local client = getLocalPlayer()
local sx, sy = guiGetScreenSize ( )
local rsx, rsy = sx / 1280, sy / 1024
local window = guiCreateWindow(550,560,200,200,"URG:RPG Spawner",false)
local vehList = guiCreateGridList(0,20,190,170,false,window)
local grid = guiCreateGridList(0,20,190,170,true,window)
local btnSpawn = guiGridListAddColumn(vehicle_selector_grid, "Key", 0.20)
local btnClose = guiGridListAddColumn(vehicle_selector_grid, "Name", 0.65)
guiWindowSetSizable(window, false)
guiSetVisible ( window, false )
guiGridListAddColumn(vehList, "Vehicle", 0.9)
local marker = nil
addEvent ( "NGSpawners:ShowClientSpawner", true )
addEventHandler ( "NGSpawners:ShowClientSpawner", root, function ( cars, mrker )
if ( wasEventCancelled ( ) ) then
return
end
if ( not guiGetVisible ( window ) ) then
bindKey ( "space", "down", spawnClickingFunctions )
showCursor (false )
guiSetVisible ( window, true )
guiGridListClear ( vehList )
addEventHandler ( 'onClientMarkerLeave', mrker, closeWindow )
marker = mrker
job = getElementData ( marker, "NGVehicles:JobRestriction" )
guiGridListSetItemText ( vehList, guiGridListAddRow ( vehList ), 1, "Free Vehicles", true, true )
for i, v in ipairs ( cars ) do
local name = getVehicleNameFromModel ( v )
local row = guiGridListAddRow ( vehList )
guiGridListSetItemText ( vehList, row, 1, name, false, false )
guiGridListSetItemData ( vehList, row, 1, v )
end