Jump to content

Small help with this function


Recommended Posts

Hello, I need help with this function, I tried to make the dobule click on gridlist it didn't work why? here is the function:

function spawnMyVeh(button, state, absoluteX, absoluteY) 
        triggerServerEvent("SpawnMyVehicle", localPlayer, ID) 
        setTimer(function() 
            vehsa = getElementData(localPlayer,"spawnedcars") or {} 
vehs = "" 
for ind,veh in ipairs(vehsa) do 
if vehs ~= "" then  
vehs = vehs..", "..veh..""  
else  
vehs = vehs..""..veh..""   
end 
end 
guiSetText(currentVehLabel, "Current Vehicle: "..vehs) 
        end,1000,1) 
                end 
addEventHandler ( "onClientDoubleClick", root, spawnMyVeh) 

Link to comment
function spawnMyVeh(button, state, absoluteX, absoluteY) 
    if (source == gridListVariable) then 

addEventHandler("onClientGUIDoubleClick", guiRoot, spawnMyVeh) 

Change 'gridListVariable' to the grid list's variable.

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