Jump to content

Problem!? this worked before on the older version 1.4


Dazee

Recommended Posts

WARNING: job_limodriver\limodriver_veh_c.lua:40: Bad argument @ 'warpPedIntoVehicle'[Expected ped at argument 1, got nil] 

I get that error in debugscript when i try to spawn a vehicle and it does spawn it but never warps the player in the car

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
    function openLimoVeh() 
        GUIEditor.window[1] = guiCreateWindow(683, 306, 305, 359, "Job Vehicle Spawner", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        GUIEditor.gridlist[1] = guiCreateGridList(10, 23, 284, 282, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicles", 0.9) 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Limo", false, false) 
        GUIEditor.button[1] = guiCreateButton(20, 311, 98, 38, "Spawn Vehicle", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(186, 311, 98, 38, "Close", false, GUIEditor.window[1])     
       showCursor(true) 
       addEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) 
       addEventHandler("onClientGUIClick",getRootElement(),onClickBtnSpawnVeh) 
    end 
addEvent("openLimoVehMenu",true) 
addEventHandler("openLimoVehMenu",getRootElement(),openLimoVeh) 
  
function onClickBtnClose(button,state) 
if (button == "left" and state == "up") then 
   if (source == GUIEditor.button[2]) then 
    guiSetInputEnabled(false) 
    guiSetVisible(GUIEditor.window[1], false) 
    destroyElement(GUIEditor.window[1]) 
    showCursor(false) 
    removeEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) 
end 
end 
end 
function delayed() 
     local vehList = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
     if vehList == nil or vehList == false then 
        outputChatBox("You need to select a vehicle!",0,255,255) 
        elseif vehList == "Limo" then 
          local x,y,z = getElementPosition(getLocalPlayer()) 
          local limoJobVeh = createVehicle ( 409, x, y, z + 3 ) 
          warpPedIntoVehicle(source,limoJobVeh) 
end 
end 
addEvent("delayedVehSpawn",true) 
addEventHandler("delayedVehSpawn",getRootElement(),delayed) 
function onClickBtnSpawnVeh(button,state) 
if (button == "left" and state == "up") then 
   if (source == GUIEditor.button[1]) then 
   triggerEvent("delayedVehSpawn",getLocalPlayer()) 
end 
end 
end 

Link to comment
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
    function openLimoVeh() 
        GUIEditor.window[1] = guiCreateWindow(683, 306, 305, 359, "Job Vehicle Spawner", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        GUIEditor.gridlist[1] = guiCreateGridList(10, 23, 284, 282, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicles", 0.9) 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Limo", false, false) 
        GUIEditor.button[1] = guiCreateButton(20, 311, 98, 38, "Spawn Vehicle", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(186, 311, 98, 38, "Close", false, GUIEditor.window[1])     
       showCursor(true) 
       addEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) 
       addEventHandler("onClientGUIClick",getRootElement(),onClickBtnSpawnVeh) 
    end 
addEvent("openLimoVehMenu",true) 
addEventHandler("openLimoVehMenu",getRootElement(),openLimoVeh) 
  
function onClickBtnClose(button,state) 
if (button == "left" and state == "up") then 
   if (source == GUIEditor.button[2]) then 
    guiSetInputEnabled(false) 
    guiSetVisible(GUIEditor.window[1], false) 
    destroyElement(GUIEditor.window[1]) 
    showCursor(false) 
    removeEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) 
end 
end 
end 
function delayed() 
     local vehList = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
     if vehList == nil or vehList == false then 
        outputChatBox("You need to select a vehicle!",0,255,255) 
        elseif vehList == "Limo" then 
          local x,y,z = getElementPosition(getLocalPlayer()) 
          local limoJobVeh = createVehicle ( 409, x, y, z + 3 ) 
          warpPedIntoVehicle(getLocalPlayer(),limoJobVeh) 
end 
end 
addEvent("delayedVehSpawn",true) 
addEventHandler("delayedVehSpawn",getRootElement(),delayed) 
function onClickBtnSpawnVeh(button,state) 
if (button == "left" and state == "up") then 
   if (source == GUIEditor.button[1]) then 
   triggerEvent("delayedVehSpawn",getLocalPlayer()) 
end 
end 
  

Link to comment
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
    function openLimoVeh() 
        GUIEditor.window[1] = guiCreateWindow(683, 306, 305, 359, "Job Vehicle Spawner", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        GUIEditor.gridlist[1] = guiCreateGridList(10, 23, 284, 282, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Vehicles", 0.9) 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Limo", false, false) 
        GUIEditor.button[1] = guiCreateButton(20, 311, 98, 38, "Spawn Vehicle", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(186, 311, 98, 38, "Close", false, GUIEditor.window[1])     
       showCursor(true) 
       addEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) 
       addEventHandler("onClientGUIClick",getRootElement(),onClickBtnSpawnVeh) 
    end 
addEvent("openLimoVehMenu",true) 
addEventHandler("openLimoVehMenu",getRootElement(),openLimoVeh) 
  
function onClickBtnClose(button,state) 
if (button == "left" and state == "up") then 
   if (source == GUIEditor.button[2]) then 
    guiSetInputEnabled(false) 
    guiSetVisible(GUIEditor.window[1], false) 
    destroyElement(GUIEditor.window[1]) 
    showCursor(false) 
    removeEventHandler("onClientGUIClick",getRootElement(),onClickBtnClose) 
end 
end 
end 
function delayed() 
     local vehList = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
     if vehList == nil or vehList == false then 
        outputChatBox("You need to select a vehicle!",0,255,255) 
        elseif vehList == "Limo" then 
          local x,y,z = getElementPosition(getLocalPlayer()) 
          local limoJobVeh = createVehicle ( 409, x, y, z + 3 ) 
          warpPedIntoVehicle(localPlayer,limoJobVeh) 
end 
end 
addEvent("delayedVehSpawn",true) 
addEventHandler("delayedVehSpawn",getRootElement(),delayed) 
function onClickBtnSpawnVeh(button,state) 
if (button == "left" and state == "up") then 
   if (source == GUIEditor.button[1]) then 
   triggerEvent("delayedVehSpawn",getLocalPlayer()) 
end 
end 
  

Edit: sorry i didn't see the preview post i didn't refresh the page

Edited by Guest
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...