Jump to content

Destroyer.-

Members
  • Posts

    103
  • Joined

  • Last visited

Everything posted by Destroyer.-

  1. local markersPosition = { {1715.3720703125, -2138.09375, 12.546875}, {1684.328125, -2086.080078125, 12.546875}, {2454.8046875, -1708.7099609375, 12.61628818512}, {1938.380859375, -1066.4912109375, 23.417552947998}, {1321.353515625, -1075.5107421875, 28.1796875}, {662.88385009766,-1487.4228515625,13.8515625}, {824.06341552734,-849.47668457031,68.921806335449}, {1271.7863769531,294.98532104492,19.656307220459}, {2314.1171875,56.500453948975,25.480714797974}, {2273.2758789063,-132.70761108398,27.153547286987}, {609.37469482422,-559.22979736328,15.672647476196}, {-1804.85,558.45,34.15}, {-752.6,-131.6,64.8}, } progreso = 0 function getNewLocation ( player, seat ) local vehicle = getPedOccupiedVehicle ( player ) local id = getElementModel ( vehicle ) if ( id == 448 ) and ( seat == 0 ) and ( progreso == 0 ) then outputChatBox ( "[iNFO]Ve a la pizza para ganar $",255,255,0 ) local num = math.random ( #markersPosition ) marker = createMarker ( markersPosition [ num ] [ 1 ], markersPosition [ num ] [ 2 ], markersPosition [ num ] [ 3 ], "cylinder", 3.5, 255, 255, 0 ) blip = createBlipAttachedTo ( marker, 51 ) progreso = 1 addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement and getElementType ( hitElement ) == "player" and hitElement == localPlayer ) then destroyElement ( marker ) destroyElement ( blip ) outputChatBox ( "[iNFO]Entregaste una pizza y ganaste $2000 ",255,255,0 ) triggerServerEvent("dinerito", player, "dinero") setTimer ( getNewLocation, 2000, 1, localPlayer, seat ) end end ) if (getElementModel(source) == 448 ) and ( getElementModel (thePlayer) == 155 ) then if isTimer ( myTimer ) then killTimer ( myTimer ) end end end addEventHandler ( "onClientVehicleEnter", root, getNewLocation ) function removebeagle ( thePlayer, seat, jacked ) outputChatBox ("Tienes 10 Segundos para volver al vehiculo si no perderas la mision",255,255,0 ) myTimer = setTimer ( function(player) outputChatBox ( "[EMPLEO]Mision Fracasada!!!",255,255,0 ) destroyElement ( marker ) destroyElement ( blip ) progreso = 0 end, 10000, 1 ) end end addEventHandler ( "onClientVehicleExit", getRootElement(), removebeagle ) Mira , puse el killtimer arriba en el evento de enter y sigue sin funcionar , y puse el ejemplo que vos me dijiste y nada , me podias ayudar a arreglarlo, por favor?
  2. Me darias un ejemplo por que me sigue dando error y no anda la function
  3. local markersPosition = { {1715.3720703125, -2138.09375, 12.546875}, {1684.328125, -2086.080078125, 12.546875}, {2454.8046875, -1708.7099609375, 12.61628818512}, {1938.380859375, -1066.4912109375, 23.417552947998}, {1321.353515625, -1075.5107421875, 28.1796875}, {662.88385009766,-1487.4228515625,13.8515625}, {824.06341552734,-849.47668457031,68.921806335449}, {1271.7863769531,294.98532104492,19.656307220459}, {2314.1171875,56.500453948975,25.480714797974}, {2273.2758789063,-132.70761108398,27.153547286987}, {609.37469482422,-559.22979736328,15.672647476196}, {-1804.85,558.45,34.15}, {-752.6,-131.6,64.8}, } progreso = 0 function getNewLocation ( player, seat ) local vehicle = getPedOccupiedVehicle ( player ) local id = getElementModel ( vehicle ) if ( id == 448 ) and ( seat == 0 ) and ( progreso == 0 ) then outputChatBox ( "[iNFO]Ve a la pizza para ganar $",255,255,0 ) local num = math.random ( #markersPosition ) marker = createMarker ( markersPosition [ num ] [ 1 ], markersPosition [ num ] [ 2 ], markersPosition [ num ] [ 3 ], "cylinder", 3.5, 255, 255, 0 ) blip = createBlipAttachedTo ( marker, 51 ) progreso = 1 addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement and getElementType ( hitElement ) == "player" and hitElement == localPlayer ) then destroyElement ( marker ) destroyElement ( blip ) outputChatBox ( "[iNFO]Entregaste una pizza y ganaste $2000 ",255,255,0 ) triggerServerEvent("dinerito", player, "dinero") setTimer ( getNewLocation, 2000, 1, localPlayer, seat ) end end ) end end addEventHandler ( "onClientVehicleEnter", root, getNewLocation ) function removebeagle ( thePlayer, seat, jacked ) outputChatBox ("Tienes 10 Segundos para volver al vehiculo si no perderas la mision",255,255,0 ) if ( getElementModel ( source ) == 448 ) then lol = isTimer(source) setTimer (function(player) outputChatBox ( "[EMPLEO]Mision Fracasada!!!",255,255,0 ) destroyElement ( marker ) destroyElement ( blip ) end, 4000, 1, source) end addEventHandler ( "onClientVehicleExit", getRootElement(), removebeagle, source) function enter(thePlayer , seat) if (getElementModel(source) == 448 ) and ( getElementModel (thePlayer) == 155 ) then if isTimer ( lol ) then killTimer ( lol ) end end end end addEventHandler ("OnClientVehicleEnter", getRootElement(), enter) intente haci pero no funciono ,dejo de funcionar la function removebeagle y salta un warning en el debugscript del addEventHandler de la function removebeagle
  4. NO no funciona , lo que quiero hacer es que cuando entre al vehiculo despues de salir se destruya el timer pero no se commo hacerlo , osea nose como hacerlo que al entrar al vehiculo se cancele ese timer que hice
  5. No no da ninguno, es que cuando yo me salgo del vehiculo lo que quiero que haga es que me de 10 segundos para regresar , y si no regres oen esos 10 segundos fracase la mision, y quiero que si se metio devuelta al vehiculo se cansele el timer
  6. Hola tengo un problema con el timer en este script de Pizzero, lo que pasa es que cuando salgo del vehiculo quiero que si en 10 segundos no entra acabe , pero no acaba Client: local markersPosition = { {1715.3720703125, -2138.09375, 12.546875}, {1684.328125, -2086.080078125, 12.546875}, {2454.8046875, -1708.7099609375, 12.61628818512}, {1938.380859375, -1066.4912109375, 23.417552947998}, {1321.353515625, -1075.5107421875, 28.1796875}, {662.88385009766,-1487.4228515625,13.8515625}, {824.06341552734,-849.47668457031,68.921806335449}, {1271.7863769531,294.98532104492,19.656307220459}, {2314.1171875,56.500453948975,25.480714797974}, {2273.2758789063,-132.70761108398,27.153547286987}, {609.37469482422,-559.22979736328,15.672647476196}, {-1804.85,558.45,34.15}, {-752.6,-131.6,64.8}, } progreso = 0 function getNewLocation ( player, seat ) local vehicle = getPedOccupiedVehicle ( player ) local id = getElementModel ( vehicle ) if ( id == 448 ) and ( seat == 0 ) and ( progreso == 0 ) then outputChatBox ( "[iNFO]Ve a la pizza para ganar $",255,255,0 ) local num = math.random ( #markersPosition ) marker = createMarker ( markersPosition [ num ] [ 1 ], markersPosition [ num ] [ 2 ], markersPosition [ num ] [ 3 ], "cylinder", 3.5, 255, 255, 0 ) blip = createBlipAttachedTo ( marker, 51 ) progreso = 1 addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement and getElementType ( hitElement ) == "player" and hitElement == localPlayer ) then destroyElement ( marker ) destroyElement ( blip ) outputChatBox ( "[iNFO]Entregaste una pizza y ganaste $2000 ",255,255,0 ) triggerServerEvent("dinerito", player, "dinero") setTimer ( getNewLocation, 2000, 1, localPlayer, seat ) end end ) end end addEventHandler ( "onClientVehicleEnter", root, getNewLocation ) function removebeagle ( thePlayer, seat, jacked ) outputChatBox ("Tienes 10 Segundos para volver al vehiculo si no perderas la mision",255,255,0 ) if ( getElementModel ( source ) == 448 and progreso == 0 ) then local Timer = setTimer ( function(player) outputChatBox ( "[EMPLEO]Mision Fracasada!!!",255,255,0 ) destroyElement ( marker ) destroyElement ( blip ) end, 10000, 1 ) end end addEventHandler ( "onClientVehicleExit", getRootElement(), removebeagle ) Gracias
  7. Si pero lo que necesito es especificamente de 10 en 10 o de 20 en 20 pero eso me da plata bonus en todos los arrestos
  8. Hola hay alguna forma de reemplazar tantos ifs .. else.. if (ap == 10) then givePlayerMoney(player, 10000) outputChatBox("[iNFO]BONUS: $10.000",player,0,255,255) elseif (ap == 20) then givePlayerMoney(player, 20000) outputChatBox("[iNFO]BONUS: $20.000",player,0,255,255) elseif (ap == 30) then givePlayerMoney(player, 30000) outputChatBox("[iNFO]BONUS: $30.000",player,0,255,255) end end Gracias :c
  9. Sisi es un test para el contador y gracias si funciono
  10. Hola me pueden ayudar es que estoy tratando de hacer un contador de arrestos y como test quiero hacer esto pero no me funciona me aparece attempt to perform arithmetic on local 'point' (a nil value) function asd(player) ap = getElementData(player,"arrests") local point = tonumber(ap) setElementData(player,"arrests", point + 1) end addCommandHandler("holaxd", asd)
  11. Hola, que funcion tendria que usar para que me siga un player , es para el poli que cuando arreste me siga . ayuda pls
  12. Hola me podrian ayudar con el job este de medico es que cura cuando pegas con el spray pero cuando roseas tose y le duele aca el code Teame = createTeam("Medico", 0, 255, 255) CT = { [Teame] = true } CV = { [596] = true } function MedicSet () local team = getTeamFromName ( "Medico" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 255, 255 ) setElementModel(source, 275) giveWeapon ( source, 41, 9999) setElementData( source, "Ocupacion", "Paramedico.", true ) outputChatBox("[EMPLEO]Ahora sos Paramedico",thePlayer,0,255,255) else local teamx = getTeamFromName ( "Medico" ) if teamx then cancelEvent() outputChatBox("You do not need to use this again!", thePlayer) end end end addEvent("Medic.saPDj", true) addEventHandler("Medic.saPDj", root, MedicSet ) local skin = {[275] = true} --Script by Catch22 --Please do not copy this --This IS my first script --Enjoy!!! --Medic function healFlowers (attacker, attackerweapon, bodypart, loss) theHealth = getElementHealth (source) if not skin[getElementModel(attacker)] then return end --checks attackers skin if ( theHealth > 95 ) then --checks clients health if (getPlayerMoney(attacker) < 200) then --checks attacker money setPlayerMoney (attacker, 0) else takePlayerMoney (attacker, 200) --takes attackers money for DMing to earn more outputChatBox("Hospital: Don't DM to get more money. Your pay has been lowered.",attacker,0,255,255) --info in chatbox end else if (attackerweapon == 41) and (loss > 1) and ( theHealth < 95 ) then setElementHealth ( source, theHealth+17 ) --sets clients health+17 givePlayerMoney (attacker, 200) --pays the medic -- you can change the 1.7 to another number or the whole equation to make a different payout end end addEventHandler ("onPlayerDamage", getRootElement(), healFlowers ) --Medic vehicle lock medicVehicles = { [416]=true } --sets the medic vehicles medicSkins = { [275]=true } -- sets the medic skins function medicenterVehicle ( player, seat, jacked ) if ( medicVehicles[getElementModel ( source )] ) and ( not medicSkins[getElementModel ( player )] ) and ( seat == 0 ) then --checks player skin cancelEvent() outputChatBox ( "*You must be a medic to use this vehicle.", player ) --info in chatbox end end addEventHandler ( "onVehicleStartEnter", getRootElement(), medicenterVehicle ) Ayuda pls
  13. hice esto pero no me funciona, sorry es que soy nuevo function showVehicledestroy ( ) vehicles = getElementsByType ( "vehicle" ) for vehicleKey, vehicleValue in ipairs(vehicles) do blowVehicle ( vehicleValue ) end end addCommandHandler ( "destroy", showVehicledestroy )
  14. Hola, como haria que si estoy en un vehiculo con el comando "/de" se destruya ? Gracias
  15. Muchas gracias , me vino muy bien.
  16. No , pero ¿Que funciones tendria que usar o como lo haria? gracias
  17. Hola, mi duda es que si existe una forma de que no pueda salir del vehiculo y con dicho comando pueda , gracias e.e
  18. Hola , como dice el titulo como podria juntar estos dos resources, lo que quiero es que cuando 1 entra al team se creen los markers, intente pero hice cualquier cosa --client-side inicial = createMarker ( 1455.9323730469,-1438.9974365234,12.3828125,"cylinder", 1.0,0,255,0,150) function primergolpe(hitElement, matchingDimension) if inicial and getElementType(hitElement) == "player" then destroyElement(inicial) outputChatBox("Test 1.",255,20,20) segundo = createMarker (1453.9360351563,-1458.3642578125,12.362445831299,"cylinder", 1.0,0,255,0,150) addEventHandler( "onClientMarkerHit", segundo, segundogolpe ) end end function segundogolpe(hitElement, matchingDimension) if segundo and getElementType(hitElement) == "player" then destroyElement(segundo) outputChatBox("Test 2",255,20,20) triggerServerEvent("dinero",localPlayer) end end addEventHandler( "onClientMarkerHit", inicial, primergolpe ) -- Server-Side addEvent("dinero",true) addEventHandler("dinero",root, function () givePlayerMoney(source,3000) giveWeapon ( source, 31, 50 ) giveWeapon ( source, 27, 12 ) giveWeapon ( source, 24, 12 ) giveWeapon ( source, 34, 2 ) giveWeapon ( source, 29, 40 ) end) con --client-side GUIEditor = { window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(324, 163, 419, 294, "Vendedor de Armas", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible (GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(30, 31, 379, 170, "Bienvenido a Vendedor de Armas ", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) close = guiCreateButton(31, 222, 113, 43, "Cancelar", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", close, showGUIbf, false) accept = guiCreateButton(284, 223, 100, 42, "Aceptar", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", accept, showGUIbf, false) addEventHandler("onClientGUIClick", accept, joinTeam, false) end ) local joinBD = createMarker(970.18249511719,-1521.5975341797,12.552214622498, "cylinder", 2.5, 255, 20, 20) addEventHandler( "onClientResourceStart", getRootElement( ), function ( startedRes ) createBlipAttachedTo( joinBD, 56); end ); function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end addEventHandler("onClientMarkerHit", joinBD, showGUIbt) function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end function joinTeam() triggerServerEvent("armas", localPlayer, "vendedor") end --serverside function vendedor ( ) local team = getTeamFromName ( "Criminal" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 255, 20, 20 ) setElementData( source, "Ocupacion", "Vendedor de Armas.", true ) outputChatBox("[EMPLEO]Ahora sos Vendedor de armas", thePlayer,255,255,0) else local teamw = getTeamFromName ( "Criminal" ) if teamw then cancelEvent() outputChatBox("Ya eres Vendedor de Armas!", source) end end end addEvent ( "armas", true) addEventHandler ( "armas", root, vendedor ) PD: tenganme paciencia soy nuevo en esto
  19. Ahora si , ya muchas gracias , espero no haberte molestado tanto tiempo
  20. a ok gracias, y si quiero que cuando pasa por el marker le de $40 ejemplo uso givePlayerMoney(40) o en el server con esta funcion triggerServerEvent
  21. sorry , tengo que preguntar algo ¿ Esto lo ven todos los players ? Yo quiero que sea solo para 1 porque estyo haciendo tipo "una mision" y si uno inicia la mision , ¿ los otros ven tambien el marker? no se si me explico bien
  22. Sigue sin destruirse el segundo y tira debug Bad argument @addEventHandler [Expected Element at arguments 2, got nil ]
  23. OSea mira cuando yo paso por el primero se destruye : Bien Cuando paso por el segundo no se destruye y eso quiero e.e
×
×
  • Create New...