Jump to content

kevincouto6

Members
  • Posts

    235
  • Joined

  • Last visited

Everything posted by kevincouto6

  1. Eai, pessoal poderiam me ajudar com isso Lado Client createMarkerLocations1 = { {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations2 = { {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations3 = { {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations4 = { {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations5 = { {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } function callServerFunction() function createRandomMarker(table) local randomRow = math.random(1,#table) return createMarker(table[randomRow][1], table[randomRow][2], table[randomRow][3], table[randomRow][4], table[randomRow][5], table[randomRow][6], table[randomRow][7], table[randomRow][8], table[randomRow][9]) end local markerElement1 = createRandomMarker(createMarkerLocations1) markerFim1 = createBlipAttachedTo ( markerElement1, 19 ) local markerElement2 = createRandomMarker(createMarkerLocations2) markerFim2 = createBlipAttachedTo ( markerElement2, 19 ) local markerElement3 = createRandomMarker(createMarkerLocations3) markerFim3 = createBlipAttachedTo ( markerElement3, 19 ) local markerElement4 = createRandomMarker(createMarkerLocations4) markerFim4 = createBlipAttachedTo ( markerElement4, 19 ) local markerElement5 = createRandomMarker(createMarkerLocations5) markerFim5 = createBlipAttachedTo ( markerElement5, 19 ) function partfim1 (source) if veh5[client] and isElement(veh5[client]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement1) setElementVisibleTo ( markerFim1, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement1 ,partfim1) function partfim2 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement2) setElementVisibleTo ( markerFim2, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement2 ,partfim2) function partfim3 (source) if callServerFunction (server, veh5[source]) and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement3) setElementVisibleTo ( markerFim3, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement3 ,partfim3) function partfim4 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement4) setElementVisibleTo ( markerFim4, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement4 ,partfim4) function partfim5 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement5) setElementVisibleTo ( markerFim5, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement5 ,partfim5) end addEvent ("mission5", true) addEventHandler ("mission5", getRootElement(), callServerFunction) Este é o lada server bom meu problema e fazer ele detectar o veiculo que foi criado no lado server, mas " if veh5[source] and is Element (veh5[source]) then " ele não funciona no lado client o que devo fazer pra resolver isso, alguem pode me ajudar ? --mission five-- cardrivepoints = 0 i = 1 -- contador global veh5 = {} -- Recomendo que evite posi趥s decimais muito grandes. Use s?頳 casas decimais. localitionveh55 = { [1] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [2] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [3] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [4] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [5] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, -- O primeiro, quinto e sexto valor das posi趥s n䯠est䯠sendo usados. Recomendo que delete-os. } function inicio5 () if isElement (veh5[client]) then -- Client = localPlayer, somente neste caso. destroyElement (veh5[client]) veh5[client] = nil end local vx ,vy, vz, vrot = localitionveh55[ i ][ 2 ], localitionveh55[ i ][ 3 ], localitionveh55[ i ][ 4 ], localitionveh55[ i ][ 7 ] i = i + 1 if i > #localitionveh55 then -- se i > 5, ent䯺 i = 1 end Trabalho = true veh5[client] = createVehicle ( 401, vx, vy, vz, 0, 0, vrot ) warpPedIntoVehicle (client, veh5[client]) outputChatBox ("#ffff00Drive the veh5icle to the checkpoint. Note: You cannot leave the car during the mission.", client, 0, 0, 0, true) triggerClientEvent (client, "mission5", client) local player2 = client addEventHandler ( "onVehicleExplode", veh5[client], function () if (veh5[player2]) and isElement(veh5[player2]) then destroyElement (source) takePlayerMoney ( player2, 5000 ) outputChatBox("Mission failed, your veh5icle blew up.", player2 , 255, 0, 0) end end) end addEvent ("iniciaJob5", true) -- Cria o evento "iniciaJob e permite que ele seja chamado pelo client. addEventHandler ("iniciaJob5", getRootElement(), inicio5) -- Executa essa fun褯 quando o evento "iniciaJob" for chamado.
  2. could help me, I passed the markers to the client side, but now it is not possible to detect the car that is on the server side, it is possible to change "if veh5[source] and isElement(veh5[source]) then" to detect on the side server ? client createMarkerLocations1 = { {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations2 = { {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations3 = { {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations4 = { {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations5 = { {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } function callServerFunction() function createRandomMarker(table) local randomRow = math.random(1,#table) return createMarker(table[randomRow][1], table[randomRow][2], table[randomRow][3], table[randomRow][4], table[randomRow][5], table[randomRow][6], table[randomRow][7], table[randomRow][8], table[randomRow][9]) end local markerElement1 = createRandomMarker(createMarkerLocations1) markerFim1 = createBlipAttachedTo ( markerElement1, 19 ) local markerElement2 = createRandomMarker(createMarkerLocations2) markerFim2 = createBlipAttachedTo ( markerElement2, 19 ) local markerElement3 = createRandomMarker(createMarkerLocations3) markerFim3 = createBlipAttachedTo ( markerElement3, 19 ) local markerElement4 = createRandomMarker(createMarkerLocations4) markerFim4 = createBlipAttachedTo ( markerElement4, 19 ) local markerElement5 = createRandomMarker(createMarkerLocations5) markerFim5 = createBlipAttachedTo ( markerElement5, 19 ) function partfim1 (source) if veh5[client] and isElement(veh5[client]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement1) setElementVisibleTo ( markerFim1, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement1 ,partfim1) function partfim2 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement2) setElementVisibleTo ( markerFim2, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement2 ,partfim2) function partfim3 (source) if callServerFunction (server, veh5[source]) and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement3) setElementVisibleTo ( markerFim3, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement3 ,partfim3) function partfim4 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement4) setElementVisibleTo ( markerFim4, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement4 ,partfim4) function partfim5 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement5) setElementVisibleTo ( markerFim5, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onClientMarkerHit",markerElement5 ,partfim5) end addEvent ("mission5", true) addEventHandler ("mission5", getRootElement(), callServerFunction) server --mission five-- cardrivepoints = 0 i = 1 -- contador global veh5 = {} -- Recomendo que evite posi趥s decimais muito grandes. Use s?頳 casas decimais. localitionveh55 = { [1] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [2] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [3] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [4] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [5] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, -- O primeiro, quinto e sexto valor das posi趥s n䯠est䯠sendo usados. Recomendo que delete-os. } function inicio5 () if isElement (veh5[client]) then -- Client = localPlayer, somente neste caso. destroyElement (veh5[client]) veh5[client] = nil end local vx ,vy, vz, vrot = localitionveh55[ i ][ 2 ], localitionveh55[ i ][ 3 ], localitionveh55[ i ][ 4 ], localitionveh55[ i ][ 7 ] i = i + 1 if i > #localitionveh55 then -- se i > 5, ent䯺 i = 1 end Trabalho = true veh5[client] = createVehicle ( 401, vx, vy, vz, 0, 0, vrot ) warpPedIntoVehicle (client, veh5[client]) outputChatBox ("#ffff00Drive the veh5icle to the checkpoint. Note: You cannot leave the car during the mission.", client, 0, 0, 0, true) triggerClientEvent (client, "mission5", client) local player2 = client addEventHandler ( "onVehicleExplode", veh5[client], function () if (veh5[player2]) and isElement(veh5[player2]) then destroyElement (source) takePlayerMoney ( player2, 5000 ) outputChatBox("Mission failed, your veh5icle blew up.", player2 , 255, 0, 0) end end) end addEvent ("iniciaJob5", true) -- Cria o evento "iniciaJob e permite que ele seja chamado pelo client. addEventHandler ("iniciaJob5", getRootElement(), inicio5) -- Executa essa fun褯 quando o evento "iniciaJob" for chamado.
  3. Hello, I am not able to make "onMarkerHit" work on the Client because I need to have the marker be created in the Client because it is individual for each player, but it is important to "onMarkerHit" work on the Client while on the server, If someone can help me, thx Server --mission five-- cardrivepoints = 0 i = 1 -- contador global veh5 = {} -- Recomendo que evite posi趥s decimais muito grandes. Use s?頳 casas decimais. localitionveh55 = { [1] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [2] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [3] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [4] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, [5] = {401, 216.82504, 1870.22961, 17.3440, 0, 0, 270}, -- O primeiro, quinto e sexto valor das posi趥s n䯠est䯠sendo usados. Recomendo que delete-os. } function inicio5 () if isElement (veh5[client]) then -- Client = localPlayer, somente neste caso. destroyElement (veh5[client]) veh5[client] = nil end local vx ,vy, vz, vrot = localitionveh55[ i ][ 2 ], localitionveh55[ i ][ 3 ], localitionveh55[ i ][ 4 ], localitionveh55[ i ][ 7 ] i = i + 1 if i > #localitionveh55 then -- se i > 5, ent䯺 i = 1 end Trabalho = true veh5[client] = createVehicle ( 401, vx, vy, vz, 0, 0, vrot ) warpPedIntoVehicle (client, veh5[client]) outputChatBox ("#ffff00Drive the veh5icle to the checkpoint. Note: You cannot leave the car during the mission.", client, 0, 0, 0, true) triggerClientEvent (client, "mission5", client) function partfim1 (source) if veh5[client] and isElement(veh5[client]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement1) setElementVisibleTo ( markerFim1, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onMarkerHit",markerElement1 ,partfim1) function partfim2 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement2) setElementVisibleTo ( markerFim2, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onMarkerHit",markerElement2 ,partfim2) function partfim3 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement3) setElementVisibleTo ( markerFim3, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onMarkerHit",markerElement3 ,partfim3) function partfim4 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement4) setElementVisibleTo ( markerFim4, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onMarkerHit",markerElement4 ,partfim4) function partfim5 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) destroyElement (markerElement5) setElementVisibleTo ( markerFim5, root, false ) end if cardrivepoints >= 5 then completed(source) end end addEventHandler("onMarkerHit",markerElement5 ,partfim5) local player2 = client addEventHandler ( "onVehicleExplode", veh5[client], function () if (veh5[player2]) and isElement(veh5[player2]) then destroyElement (source) takePlayerMoney ( player2, 5000 ) outputChatBox("Mission failed, your veh5icle blew up.", player2 , 255, 0, 0) end end) end addEvent ("iniciaJob5", true) -- Cria o evento "iniciaJob e permite que ele seja chamado pelo client. addEventHandler ("iniciaJob5", getRootElement(), inicio5) -- Executa essa fun褯 quando o evento "iniciaJob" for chamado. Client createMarkerLocations1 = { {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations2 = { {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations3 = { {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations4 = { {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations5 = { {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } function callServerFunction() function createRandomMarker(table) local randomRow = math.random(1,#table) return createMarker(table[randomRow][1], table[randomRow][2], table[randomRow][3], table[randomRow][4], table[randomRow][5], table[randomRow][6], table[randomRow][7], table[randomRow][8], table[randomRow][9]) end local markerElement1 = createRandomMarker(createMarkerLocations1) markerFim1 = createBlipAttachedTo ( markerElement1, 19 ) local markerElement2 = createRandomMarker(createMarkerLocations2) markerFim2 = createBlipAttachedTo ( markerElement2, 19 ) local markerElement3 = createRandomMarker(createMarkerLocations3) markerFim3 = createBlipAttachedTo ( markerElement3, 19 ) local markerElement4 = createRandomMarker(createMarkerLocations4) markerFim4 = createBlipAttachedTo ( markerElement4, 19 ) local markerElement5 = createRandomMarker(createMarkerLocations5) markerFim5 = createBlipAttachedTo ( markerElement5, 19 ) end addEvent ("mission5", true) addEventHandler ("mission5", getRootElement(), callServerFunction)
  4. I have one more question, and is it possible to create the marker just for who is doing the mission? Examples create individually marker for each player @aka Blue @Patrick2562
  5. 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.
  6. kevincouto6

    Help Ha

    Hello, I've come to ask for help because I have a problem with "addEventHandler (" onMarkerHit ")" From what I can understand he is not detecting the Markers, but the makers are only created when the mission is started, as a way to solve this error ? WARNING: GUImission/server.lua:113 Bad argument @ " addEventHandler { expected element at argument 2,got nill} --mission five-- cardrivepoints = 0 createMarkerLocations1 = { {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.41704, 1877.68689, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations2 = { {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {231.85756, 1892.57666, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations3 = { {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {229.22476, 1906.36658, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations4 = { {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {212.10025, 1908.91870, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations5 = { {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 0 ,255 ,0, 255}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170 }, {192.29828, 1911.02271, 17.64063 -1, "cylinder", 4, 255, 255, 0, 170}, } veh5 = {} -- Recomendo que evite posições decimais muito grandes. Use só até 3 casas decimais. localitionveh55 = { [1] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [2] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [3] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [4] = {493, 238.55833, 1925.76343, 17.6480, 0, 0, 270}, [5] = {493, 238.55833, 1925.76343, 17.6480, 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 inicio5 () if isElement (veh5[client]) then -- Client = localPlayer, somente neste caso. destroyElement (veh5[client]) veh5[client] = nil end local vx ,vy, vz, vrot = localitionveh55[ i ][ 2 ], localitionveh55[ i ][ 3 ], localitionveh55[ i ][ 4 ], localitionveh55[ i ][ 7 ] i = i + 1 if i > #localitionveh55 then -- se i > 5, então: i = 1 end Trabalho = true veh5[client] = createVehicle ( 433, vx, vy, vz, 0, 0, vrot ) warpPedIntoVehicle (client, veh5[client]) outputChatBox ("#ffff00Drive the veh5icle to the checkpoint. Note: You cannot leave the car during the mission.", client, 0, 0, 0, true) function createRandomMarker(table) local randomRow = math.random(1,#table) return createMarker(table[randomRow][1], table[randomRow][2], table[randomRow][3], table[randomRow][4], table[randomRow][5], table[randomRow][6], table[randomRow][7], table[randomRow][8], table[randomRow][9]) end local markerElement1 = createRandomMarker(createMarkerLocations1) local markerElement2 = createRandomMarker(createMarkerLocations2) local markerElement3 = createRandomMarker(createMarkerLocations3) local markerElement4 = createRandomMarker(createMarkerLocations4) local markerElement5 = createRandomMarker(createMarkerLocations5) local player2 = client addEventHandler ( "onVehicleExplode", veh5[client], function () if (veh5[player2]) and isElement(veh5[player2]) then destroyElement (source) takePlayerMoney ( player2, 5000 ) outputChatBox("Mission failed, your veh5icle blew up.", player2 , 255, 0, 0) end end) end addEvent ("iniciaJob5", true) -- Cria o evento "iniciaJob e permite que ele seja chamado pelo client. addEventHandler ("iniciaJob5", getRootElement(), inicio5) -- Executa essa função quando o evento "iniciaJob" for chamado. function partfim2 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) else end end addEventHandler("onMarkerHit",markerElement2 ,partfim2) function partfim3 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) else end end addEventHandler("onMarkerHit",markerElement3 ,partfim3) function partfim4 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) else end end addEventHandler("onMarkerHit",markerElement4 ,partfim4) function partfim5 (source) if veh5[source] and isElement(veh5[source]) then cardrivepoints = cardrivepoints+1 outputChatBox("Funcionando!",source,0,0,0,true) else end end addEventHandler("onMarkerHit",markerElement5 ,partfim5) function completed(source) if cardrivepoints >= 5 then outputChatBox("#00ff00Mission passed. You successfully completed this task. You've received $10.000!",source,0,0,0,true) end end
  7. Hello, Can someone help me here? createMarkerLocations1 = { [1] = {228, 1877, 18 -1, "cylinder", 4, 0 ,255 ,0, 255}, [2] = {228, 1891, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [3] = {226, 1904, 18 -1, "cylinder", 4, 255, 255, 0, 170}, [4] = {212, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [5] = {198, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations2 = { [1] = {228, 1877, 18 -1, "cylinder", 4, 0 ,255 ,0, 255}, [2] = {228, 1891, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [3] = {226, 1904, 18 -1, "cylinder", 4, 255, 255, 0, 170}, [4] = {212, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [5] = {198, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations3 = { [1] = {228, 1877, 18 -1, "cylinder", 4, 0 ,255 ,0, 255}, [2] = {228, 1891, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [3] = {226, 1904, 18 -1, "cylinder", 4, 255, 255, 0, 170}, [4] = {212, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [5] = {198, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations4 = { [1] = {228, 1877, 18 -1, "cylinder", 4, 0 ,255 ,0, 255}, [2] = {228, 1891, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [3] = {226, 1904, 18 -1, "cylinder", 4, 255, 255, 0, 170}, [4] = {212, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [5] = {198, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170}, } createMarkerLocations5 = { [1] = {228, 1877, 18 -1, "cylinder", 4, 0 ,255 ,0, 255}, [2] = {228, 1891, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [3] = {226, 1904, 18 -1, "cylinder", 4, 255, 255, 0, 170}, [4] = {212, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170 }, [5] = {198, 1912, 18 -1, "cylinder", 4, 255, 255, 0, 170}, } Could someone help me randomly create 5 markes 1 from each table ?
  8. decrease -1 in position Z
  9. Hello, Again I need help in a script, well I have to specify the mission information, I wanted to do this with the INFO button, But I do not know how to make a text for each mission, and I also wanted to enable a COPY button for what I was writing inside the MEMO could you give me tips, or show me functions? # the INFO button is in the other GUI that I have developed # Every script is just Client-Side ! memo = guiCreateMemo ( 9,32, 175, 196, "memo Gui Testing 1",false, infoMission) memo2 = guiCreateMemo ( 9,32, 175, 196, "memo Gui Testing 2",false, infoMission) memo3 = guiCreateMemo ( 9,32, 175, 196, "memo Gui Testing 3",false, infoMission) memo4 = guiCreateMemo ( 9,32, 175, 196, "memo Gui Testing 4",false, infoMission) GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() infoMission = guiCreateWindow(599, 122, 196, 328, "Mission Description", false) guiSetVisible (infoMission, false) guiWindowSetSizable(infoMission, false) memo = guiCreateMemo(9, 32, 175, 196, "ssssssssss", false, infoMission) exitBuInfo = guiCreateButton(10, 280, 174, 40, "EXIT", false, infoMission) copyButton = guiCreateButton(9, 233, 175, 37, "COPY", false, infoMission) end ) addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) local me = not guiGetVisible (infoMission) if (source == exitBuInfo) then guiSetVisible (infoMission, me) end end) I wanted the message to be detected according to the selected item in the list, If you can help me, I'll be very happy. addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) outputDebugString("onClientGUIClick called.") local me = not guiGetVisible (WinMission) if (source == info) then outputDebugString("guiGridListGetSelectedItem(ListMissions): "..guiGridListGetSelectedItem(ListMissions)) if (guiGridListGetSelectedItem(ListMissions) == 0) then outputDebugString("1 was selected") guiSetVisible (infoMission, true) elseif (guiGridListGetSelectedItem(ListMissions) == 1) then outputDebugString("2 was selected") elseif (guiGridListGetSelectedItem(ListMissions) == 2) then outputDebugString("3 was selected") elseif (guiGridListGetSelectedItem(ListMissions) == 3) then outputDebugString("4 was selected") end end end ) Thx, since now By:Kevin6
  10. Hello, I'm asking for help because I can not specify the message for GindList type ? "Fist Misson" grindList message testing 1. "Second mission" grindList2 message testing 2. "thrind mission" grindList3 message testing 3. This script is Client-side addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) local me = not guiGetVisible (WinMission) if (source == accepted) then if ( guiGridListGetSelectedItem ( ListMissions ) ~= 1 ) then outputChatBox( "Testing 1" ) elseif ( guiGridListGetSelectedItem ( ListMissions ) ~= 2 ) then outputChatBox( "Testing 2" ) elseif ( guiGridListGetSelectedItem ( ListMissions ) ~= 3 ) then outputChatBox( "Testing 3" ) elseif ( guiGridListGetSelectedItem ( ListMissions ) ~= 4 ) then outputChatBox( "Testing 4" ) end end end) If it is possible to help me, no debug currently appears no error ? This script is Client-side addEventHandler("onClientResourceStart", resourceRoot, function () WinMission = guiCreateWindow(356, 141, 594, 329, "Mission", false) guiSetVisible (WinMission, false ) guiWindowSetSizable(WinMission, false) accepted = guiCreateButton(12, 236, 180, 34, "ACCEPTED", false, WinMission) info = guiCreateButton(207, 236, 180, 34, "INFO", false, WinMission) abandon = guiCreateButton(397, 236, 180, 34, "ABANDON", false, WinMission) ListMissions = guiCreateGridList(12, 36, 565, 190, false, WinMission) guiGridListAddColumn(ListMissions, "MISSION", 0.9) for i = 1, 11 do guinumeber = guiGridListAddRow(ListMissions) end guiGridListSetItemText(ListMissions, 0, 1, "Fist Misson", false, false) guiGridListSetItemText(ListMissions, 1, 1, "Seccond Mission", false, false) guiGridListSetItemText(ListMissions, 2, 1, "Trind Mission", false, false) guiGridListSetItemText(ListMissions, 3, 1, "-", false, false) guiGridListSetItemText(ListMissions, 4, 1, "-", false, false) guiGridListSetItemText(ListMissions, 5, 1, "-", false, false) guiGridListSetItemText(ListMissions, 6, 1, "-", false, false) guiGridListSetItemText(ListMissions, 7, 1, "-", false, false) guiGridListSetItemText(ListMissions, 8, 1, "-", false, false) guiGridListSetItemText(ListMissions, 9, 1, "-", false, false) guiGridListSetItemText(ListMissions, 10, 1, "-", false, false) Buttonexit = guiCreateButton(10, 276, 567, 43, "EXIT", false, WinMission) end ) Thx, by the attention?
  11. Queira sabe como fazer para add fuções na lista Gui, tipo que add missão na lista, tipo voçe escolhe qual missão quer fazer e depois voçe da accept na missao, e outras possibilidades tipo abandon, poderia me ajudar com isso dando dicas ou me mostrando exemplos ? -- Client Side-- GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function () WinMission = guiCreateWindow(356, 141, 594, 329, "Mission", false) guiSetVisible (WinMission, false ) guiWindowSetSizable(WinMission, false) accepted = guiCreateButton(12, 236, 180, 34, "ACCCEPTED", false, WinMission) declined = guiCreateButton(207, 236, 180, 34, "DECLINED", false, WinMission) abandon = guiCreateButton(397, 236, 180, 34, "ABANDON", false, WinMission) ListMissions = guiCreateGridList(12, 36, 565, 190, false, WinMission) guiGridListAddColumn(ListMissions, "MISSION", 0.9) for i = 1, 11 do guiGridListAddRow(ListMissions) end guiGridListSetItemText(ListMissions, 0, 1, "Fist Misson", false, false) guiGridListSetItemText(ListMissions, 1, 1, "Seccond Mission", false, false) guiGridListSetItemText(ListMissions, 2, 1, "-", false, false) guiGridListSetItemText(ListMissions, 3, 1, "-", false, false) guiGridListSetItemText(ListMissions, 4, 1, "-", false, false) guiGridListSetItemText(ListMissions, 5, 1, "-", false, false) guiGridListSetItemText(ListMissions, 6, 1, "-", false, false) guiGridListSetItemText(ListMissions, 7, 1, "-", false, false) guiGridListSetItemText(ListMissions, 8, 1, "-", false, false) guiGridListSetItemText(ListMissions, 9, 1, "-", false, false) guiGridListSetItemText(ListMissions, 10, 1, "-", false, false) Buttonexit = guiCreateButton(10, 276, 567, 43, "EXIT", false, WinMission) end ) --if you want add Marker# {}, Mark = { {209.04536, 1871.57690, 12}, } --Marker local Marker1 = createMarker(209.04536, 1871.57690, 12, "cylinder", 1.5, 250,250,0) for k,v in ipairs (Mark) do z = v[3] -1 Marker = createMarker ( v[1], v[2], z, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible (WinMission, true ) showCursor( true ) end end ) end addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) local me = not guiGetVisible (WinMission) if (source == Buttonexit) then guiSetVisible (WinMission, me) showCursor (me) end end)
  12. Hi, I've been asking GrindList for help, well I have the script, but I'll add a first mission type -- Client Side-- GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function () WinMission = guiCreateWindow(356, 141, 594, 329, "Mission", false) guiSetVisible (WinMission, false ) guiWindowSetSizable(WinMission, false) accepted = guiCreateButton(12, 236, 180, 34, "ACCCEPTED", false, WinMission) declined = guiCreateButton(207, 236, 180, 34, "DECLINED", false, WinMission) abandon = guiCreateButton(397, 236, 180, 34, "ABANDON", false, WinMission) ListMissions = guiCreateGridList(12, 36, 565, 190, false, WinMission) guiGridListAddColumn(ListMissions, "MISSION", 0.9) for i = 1, 11 do guiGridListAddRow(ListMissions) end guiGridListSetItemText(ListMissions, 0, 1, "Fist Misson", false, false) guiGridListSetItemText(ListMissions, 1, 1, "Seccond Mission", false, false) guiGridListSetItemText(ListMissions, 2, 1, "-", false, false) guiGridListSetItemText(ListMissions, 3, 1, "-", false, false) guiGridListSetItemText(ListMissions, 4, 1, "-", false, false) guiGridListSetItemText(ListMissions, 5, 1, "-", false, false) guiGridListSetItemText(ListMissions, 6, 1, "-", false, false) guiGridListSetItemText(ListMissions, 7, 1, "-", false, false) guiGridListSetItemText(ListMissions, 8, 1, "-", false, false) guiGridListSetItemText(ListMissions, 9, 1, "-", false, false) guiGridListSetItemText(ListMissions, 10, 1, "-", false, false) Buttonexit = guiCreateButton(10, 276, 567, 43, "EXIT", false, WinMission) end ) --if you want add Marker# {}, Mark = { {209.04536, 1871.57690, 12}, } --Marker local Marker1 = createMarker(209.04536, 1871.57690, 12, "cylinder", 1.5, 250,250,0) for k,v in ipairs (Mark) do z = v[3] -1 Marker = createMarker ( v[1], v[2], z, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler('onClientMarkerHit', Marker, function ( hitPlayer ) if ( hitPlayer == localPlayer ) then guiSetVisible (WinMission, true ) showCursor( true ) end end ) end addEventHandler ("onClientGUIClick", getRootElement(), function (button, state, absoluteX, absoluteY) local me = not guiGetVisible (WinMission) if (source == Buttonexit) then guiSetVisible (WinMission, me) showCursor (me) end end) here is the script I wanted to add a function to GindList 0, 1 I have a mission and I want to add then how to do?
  13. Olá no debugscript 3 não aparece nenhum erro, mas quando executo a missão, quando ele não esta detectando se o jogador entra no carro, ele apenas destroy o carro quando chega o tempo definido --Primeira parte da Missão Mfim = createMarker (-2404.80957, -599.06909, 132.64844 -1, "cylinder", 2, 0 ,255 ,0, 255) vehicle = createVehicle (402,209.89941, 1905.14233, 17.64063,0 ,0 ,0) setTimer(function(source) if isPlayerInVehicle ( vehicle ) then outputChatBox ( "Voçê esta no Vehicle", getRootElement(), 255, 255, 255, true ) else outputChatBox ( "Voçê Nao entrou no veiculo a tempo mission failed", getRootElement(), 255, 255, 255, true ) destroyElement (veh[source]) end end, 5000, 0) --segunda parte da mission) function fim (source) if vehicle and isElement(vehicle) then destroyElement (vehicle) givePlayerMoney(source,200000) outputChatBox("#00ff00Sua missão foi um sucesso",source,0,0,0,true) else end end addEventHandler("onMarkerHit",Mfim ,fim)
  14. é possivel especificar tempo em HUD, e existem alguns erros poderiam me ajudar ? --Fora da mission tempoMission = 0:00 setTimer(function(source) if tempoMission = tempoMission 0:01 end if tempoMission >= 4:00 then tempoMission () end end, 100, 0) function createText () dxDrawText("Tempo para a missão"..(tempoMission).."/4:00", 348, 4, 582, 30, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top" ) end function tempoMission () destroyElement (veh[source]) end --Primeira parte da Missão Mfim = createMarker (-2404.80957, -599.06909, 132.64844 -1, "cylinder", 2, 0 ,255 ,0, 255) function started () veh[source] = (402,-2404.80957, -599.06909, 132.64844,0 ,0 ,0 ) Bfim = createBlipAttachedTo ( veh[source], 19 ) end addCommandHandler ( "começar", started ) setTimer(function(source) if isPlayerInVehicle ( veh[source] ) then else outputChatBox ( "Voçê Nao entrou no veiculo a tempo mission failed", getRootElement(), 255, 255, 255, true ) destroyElement (veh[source]) end end, 300000, 0) --segunda parte da mission function enterCar (source) if veh[source] and isElement(veh[source]) then Bfim = createBlipAttachedTo ( veh[source], 19 ) setElementVisibleTo ( Bfim, root, false ) else end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterCar ) --Terceira parte da missão function fim (source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) givePlayerMoney(source,200000) setElementVisibleTo ( Bfim, source, false ) outputChatBox("#00ff00Sua missão foi um sucesso",source,0,0,0,true) else end end addEventHandler("onMarkerHit",Mfim ,fim)
  15. Não aparece nada, existe outra forma de verificar erros
  16. Alguem pode me ajudar a função de detectar quando o player entra na zona, não esta fazendo os peds atirar ? local ped_ = {} local peds = { {-2374.55151, -595.38910, 132.11719}, {-2376.55908, -596.57813, 132.11719}, {-2376.33325, -591.77344, 132.11171}, } function findRotation( x1, y1, x2, y2 ) local t = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) return t < 0 and t + 360 or t end function spawnPed(i) ped_[i] = createPed(math.random(26,41),peds[i][1],peds[i][2],peds[i][3]) setElementData(ped_[i],"ped:custom_ped",true) setElementData(ped_[i],"ped:index",i) end addEventHandler("onClientResourceStart",resourceRoot,function() for i=1,#peds do spawnPed(i) end end) function atirar () if source then if getElementData(source,"ped:custom_ped") then ped = source givePedWeapon(ped, 31, 500, true) setPedControlState(ped, "fire", true) end end end addEvent ("pedAtira", true) addEventHandler("onClientPedDamage", root, atirar) addEventHandler ("pedAtira", getRootElement(), atirar) function stopatirar () for _, ped in ipairs(getElementsByType("ped")) do if getElementData(ped,"ped:custom_ped") then if isElementStreamedIn (ped) then givePedWeapon(ped, 31, 500, false) setPedControlState(ped, "fire", false) end end end end addEvent ("stopPedatira", true) addEventHandler ("stopPedatira", getRootElement(), stopatirar) function handleRespawn() if getElementData(source,"ped:custom_ped") then index = getElementData(source,"ped:index") setTimer(destroyElement, 1000, 1, source) setTimer(spawnPed, 1500, 1, index) end end addEventHandler("onClientPedWasted", getRootElement(), handleRespawn) function rota () for _, ped in pairs(getElementsByType("ped")) do if getElementData(ped,"ped:custom_ped") then if isElementStreamedIn (ped) then local x1 ,y1, z1 = getElementPosition(ped) local x2, y2, z2 = getElementPosition(localPlayer) setPedAimTarget(ped, x2, y2, z2) setElementRotation(ped, 0,0,180+findRotation( x2, y2, x1, y1 )) end end end end addEventHandler("onClientRender", root, rota)
  17. Are they to make the protection of a place there is the possibility, to make them shoot when they invade the zone?
  18. has some error when the player enters the zone the peds are not shooting
  19. Could someone help me, I want to complete this work, mission is as follows the player must go to the car with the time of 5 min and get in the car and locomoverse until the "BFim", if he does not arrive in time in the vehicle will miss the mission Mfim = createMarker (-1828.72888, -1627.62219, 23.23001 -1, "cylinder", 2, 0 ,255 ,0, 255) Bfim = createBlipAttachedTo ( Mfim, 19 ) setElementVisibleTo ( Bfim, root, false ) veh = {} function started () veh[source] = (402,-2404.80957, -599.06909, 132.64844,0 ,0 ,0 ) end addCommandHandler ( "começar", started ) function enterCar (source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) = false else end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterCar ) function checkedPlayer ( ) if isPlayerInVehicle ( veh[source] ) then if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) = false else end else setTimer(function(source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) else end end, 300000, 0) end end function fim (source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) givePlayerMoney(source,200000) setElementVisibleTo ( Bfim, source, false ) outputChatBox("#00ff00Sua missão foi um sucesso",source,0,0,0,true) else end end addEventHandler("onMarkerHit",Mfim ,fim) function playerdeath () if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) setElementVisibleTo ( Bfim, source, false ) outputChatBox("#00ff00Sua missão Falhou voçe morreu!",source,0,0,0,true) else end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  20. Sorry trouble again "The functions of detecting the player entering the zone are not working the problems can be in my script server" ? ""no debug no error appears"" function atirar () if source then if getElementData(source,"ped:custom_ped") then ped = source givePedWeapon(ped, 31, 500, true) setPedControlState(ped, "fire", true) end end end addEventHandler("onClientPedDamage", root, atirar) addEvent ("pedAtira", true) addEventHandler ("pedAtira", getRootElement(), atirar) function stopatirar () for _, ped in ipairs(getElementsByType("ped")) do if getElementData(ped,"ped:custom_ped") then if isElementStreamedIn (ped) then givePedWeapon(ped, 31, 500, false) setPedControlState(ped, "fire", false) end end end end addEvent ("stopPedatira", true) addEventHandler ("stopPedatira", getRootElement(), stopatirar)
  21. Sorry for posting again, I could not edit, the scripts are not working and nothing debug appears someone would know to tell me what happens setPedAimTarget for 20 seconds he hits and then to
×
×
  • Create New...