kevincouto6 Posted November 18, 2018 Share Posted November 18, 2018 (edited) Hello, I tried several ways but it is not possible to make time to enter the vehicle, The error that is happening is this ERROR: GUImission/server.lua:512: Bad argument @ 'getVehicleOccupants'{expected vehicle at argument 1, got nill} ERROR: GUImission/server.lua:512: Bad argument #1 to "pairs' (table expected, got boolean) veh6 = {} -- Recomendo que evite posições decimais muito grandes. Use só até 3 casas decimais. localitionveh6 = { [1] = {433, 290, 2041, 18.5, 0, 0, 270}, [2] = {433, 290, 2046, 18.5, 0, 0, 270}, [3] = {433, 290, 2051, 18.5, 0, 0, 270}, [4] = {433, 290, 2056, 18.5, 0, 0, 270}, [5] = {433, 290, 2061, 18.5, 0, 0, 270}, -- O primeiro, quinto e sexto valor das posições não estão sendo usados. Recomendo que delete-os. } i = 1 -- contador global function inicio6 () if isElement (veh6[client]) then -- Client = localPlayer, somente neste caso. destroyElement (veh6[client]) veh6[client] = nil end local vx ,vy, vz, vrot = localitionveh6[ i ][ 2 ], localitionveh6[ i ][ 3 ], localitionveh6[ i ][ 4 ], localitionveh6[ i ][ 7 ] i = i + 1 if i > #localitionveh6 then -- se i > 5, então: i = 1 end Trabalho = true veh6[client] = createVehicle ( 433, vx, vy, vz, 0, 0, vrot ) setElementVisibleTo (Bfim6, client, true) outputChatBox ("#ffff00Drive the veh6icle to the checkpoint. Note: You cannot leave the car during the mission.", client, 0, 0, 0, true) local counter = 0 setTimer(function(source) for seat, player6 in pairs(getVehicleOccupants(veh6[client])) do counter = counter + 1 end if counter > 0 then outputChatBox ( "Voçê esta no veh6icle", getRootElement(), 255, 255, 255, true ) else outputChatBox ( "Voçê Nao entrou no veiculo a tempo mission failed", getRootElement(), 255, 255, 255, true ) destroyElement (veh6[source]) end counter = 0 end, 5000, 1) local player6 = client addEventHandler ( "onvehicleExplode", veh6[client], function () if (veh6[player6]) and isElement(veh6[player6]) then destroyElement (source) takePlayerMoney ( player6, 5000 ) setElementVisibleTo ( Bfim6, player6, false ) outputChatBox("Mission failed, your veh6icle blew up.", player6 , 255, 0, 0) end end) end addEvent ("iniciaJob6", true) -- Cria o evento "iniciaJob e permite que ele seja chamado pelo client. addEventHandler ("iniciaJob6", getRootElement(), inicio6) -- Executa essa função quando o evento "iniciaJob" for chamado. Edited November 18, 2018 by kevincouto6 Link to comment
MrKAREEM Posted November 18, 2018 Share Posted November 18, 2018 show server files pls and not that Link to comment
kevincouto6 Posted November 18, 2018 Author Share Posted November 18, 2018 1 hour ago, MrKAREEM said: show server files pls and not that Is server script Link to comment
#LasoPhaser Posted November 20, 2018 Share Posted November 20, 2018 On 19/11/2018 at 00:58, kevincouto6 said: Is server script Link to comment
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