kevincouto6

Members
  • Content count

    121
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kevincouto6

  • Rank
    Sucka
  1. tempo para entrar no carro

    esta parte foi removida do script
  2. tempo para entrar no carro

    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)
  3. tempo para entrar no carro

    é 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)
  4. Poderia Me ajudar

    Não aparece nada, existe outra forma de verificar erros
  5. Poderia Me ajudar

    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)
  6. How do I solve this?

    Are they to make the protection of a place there is the possibility, to make them shoot when they invade the zone?
  7. How do I solve this?

    has some error when the player enters the zone the peds are not shooting
  8. Car time for enter

    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 )
  9. How do I solve this?

    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)
  10. How do I solve this?

    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
  11. How do I solve this?

    okay Thx
  12. How do I solve this?

    Could you help me with handlerRespawn? in debugscript no error appears, And the respawn function after death is not working ?Can you tell me what to do? 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 local pedsParent = createElement("pedsParent") local id = {} -- do not edit this table for i=1,#peds do ped[i] = createPed(math.random(26,41),peds[i][1],peds[i][2],peds[i][3]) function spawnPed( peds,index) ped[i] = createPed(math.random(26,41),peds[i][1],peds[i][2],peds[i][3]) setElementParent(ped[i], pedsParent) id[ped[i]] = index end function handleRespawn() local index = id[source] if index then id[source] = nil local peds = peds[index] if peds then setTimer(destroyElement, 1000, 1, source) setTimer(spawnPed, 1500, 1, peds, index) end end end addEventHandler("onPedWasted", pedsParent, handleRespawn) function rotationpedd () local x1 ,y1, z = getElementPosition(ped[i]) local x2, y2, sz = getElementPosition(localPlayer) setPedAimTarget(ped[i], x2, y2, sz) setPedRotation(ped[i], findRotation( x1, y1, x2, y2 )) end addEventHandler("onClientRender", root, rotationpedd) function atirar () givePedWeapon(ped[i], 31, 500, true) setPedControlState(ped[i], "fire", true) end addEventHandler("onClientPedDamage", root, atirar) addEvent ("pedAtira", true) addEventHandler ("pedAtira", getRootElement(), atirar) function stopatirar () givePedWeapon(ped[i], 31, 500, false) setPedControlState(ped[i], "fire", false) end addEvent ("stopPedatira", true) addEventHandler ("stopPedatira", getRootElement(), stopatirar) end
  13. How do I solve this?

    The error keeps happening
  14. How do I solve this?

    I wanted your help because the ped is not getting the getElementPosition of all ped, and the "setPedAimTarget" is not completely working because no errors appear Client-side local ped = {} local peds = { {-2374.55151, -595.38910, 132.11719}, {-2376.55908, -596.57813, 132.11719}, {-2376.33325, -591.77344, 132.11171}, } for i=1,#peds do ped[i] = createPed(math.random(26,41),peds[i][1],peds[i][2],peds[i][3]) end 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 rotationpedd () local x1 ,y1, z = getElementPosition(peds[i]) local x2, y2, sz = getElementPosition(getLocalPlayer()) setPedAimTarget(ped[i], x2, y2, sz) setPedRotation(ped[i], findRotation( x1, y1, x2, y2 )) end addEventHandler("onClientRender", root, rotationpedd) function atirar () givePedWeapon(ped[i], 31, 500, true) setPedControlState(ped[i], "fire", true) end addEventHandler("onClientPedDamage", root, atirar) addEvent ("pedAtira", true) addEventHandler ("pedAtira", getRootElement(), atirar) function stopatirar () givePedWeapon(ped[i], 31, 500, false) setPedControlState(ped[i], "fire", false) end addEvent ("stopPedatira", true) addEventHandler ("stopPedatira", getRootElement(), stopatirar) ERROR: pedAtack/client.lua:12: attempt to peform arithmetic on local 'x1' (a boolean value) code server local zonaShot = createColRectangle ( -2400.04248, -620.97205, 50, 50 ) local radarShot = createRadarArea ( -2400.04248, -620.97205, 50, 50, 0, 255, 0, 175 ) function enterZone ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then triggerClientEvent (thePlayer, "pedAtira", thePlayer) end end addEventHandler ( "onColShapeHit", zonaShot, enterZone ) function sairZone ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then triggerClientEvent (thePlayer, "stopPedatira", thePlayer) end end addEventHandler ( "onColShapeLeave", zonaShot, sairZone )
  15. Poderia Me ajudar

    N esta funcionando, devido a não checagem da posição do ped, acredito que o erro seja na checagem de varios peds juntas se fosse apenas um funciona mas como tem mais de um ñ esta funcionando