Jump to content

Alexs

Members
  • Posts

    2,869
  • Joined

  • Last visited

Everything posted by Alexs

  1. function crearCuadrado() dxDrawRectangle(195.0,734.0,955.0,33.0,tocolor(0,0,0,150),false) end addEventHandler("onClientRender",root,crearCuadrado) function playerloc ( ) local playername = getPlayerName ( localPlayer ) local x, y, z = getElementPosition (localPlayer ) local location = getZoneName ( x, y, z ) outputChatBox ( "*" .. playername .. "'s Location: " .. location, 0, 255, 255 ) end addCommandHandler ( "loc", playerloc ) No mostrara la posición a todos, Si quieres eso tendrás que hacer un archivo en server side que contenga esto: function playerloc ( source ) local playername = getPlayerName ( source) local location = getElementZoneName ( source ) outputChatBox ( "*" .. playername .. "'s Location: " .. location, root, 0, 255, 255 ) end addCommandHandler ( "loc", playerloc )
  2. Alexs

    Ayuda Slothbot

    Se supone los bot no atacan a los del mismo team, pero no están hechos para proteger a alguien, están hechos para ser equipo.
  3. Alexs

    Spawn

    getPedWeapon getWeaponIDFromName
  4. Alexs

    Spawn

    Creo que no entiendes bien el uso de las tablas, te dejo un link para que revises por que esta mal: http://lua-users.org/wiki/TablesTutorial
  5. Alexs

    ayuda con mapa

    Quizá olvidaste o no tenias los .Col para reemplazar.
  6. @FraN-724 para que el elementData?
  7. Alexs

    Spectadores!

    mm.. ¿Que tal un ejemplo? addCommandHandler( "spectear", function ( source ) setCameraTarget( source, getRandomPlayer()) end )
  8. Alexs

    no da error

    reja = getElementByID("object (airportgate) (1)") abierta = false addCommandHandler("dkrentry", function(source) if not abierta then outputChatBox("Puerta DKR Abriendose",source,213, 255, 0) moveObject(reja,2000,2858.1000976562,2176.3999023438,9) abierta = true elseif abierta then outputChatBox("Puerta DKR Cerrandose",source,213, 255, 0) moveObject(reja,2000,2858.1000976562,2176.3999023438,12.60000038147) abierta = false end end ) Server Side. (Prácticamente hace lo mismo pero el consumo es menor)
  9. Esos reemplazan objetos (Mas adelante habrá para agregar), por ahora puedes reemplazarlos por objetos ya existentes y usarlos en un map.
  10. Quizá el problema sea que el evento no se gatillo al nadar.
  11. Cual no te funciono? Error en el debug? EDIT: No estoy seguro de que ese evento se ejecute cuando se te acaba el oxigeno.
  12. addEventHandler( "onClientPlayerDamage", localPlayer, function ( attacker ) if getPedOxygenLevel( localPlayer ) < 1 then if not attacker then cancelEvent() end end end ) Así no serán inmortales por estar en el agua.
  13. cancelEvent getPedOxygenLevel "onClientPlayerDamage"
  14. getPedWeapon --Tiene argumento de slot getPedTotalAmmo --Tambien tiene argumento de slot getSlotFromWeapon --Para conseguir un slot desde un arma
  15. Si, justo lo que pensaba, intenta con el código como te lo deje.
  16. @NOD Ok, lo entiendo, es que como pusiste 'el ID' pensé que podías hacer confundido con getElementID.
  17. Deberás ser mas especifico para saber cual es el error. Aunque quizá diga algo como: 'ERROR: cal global 'getLocalPlayer' a nil value' o algo así, eso es por usar una función en el lado incorrecto. Si es así entonces pusiste mal mi código, el caso era que borraras lo de @NOD y dejaras solo mi código y el tuyo: --Tyrant local colshape = createColRectangle ( 88.4608, 1779.9825, 400, 400 ) zombiesMatados = 0 function zona2 ( ) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = ( zombiesMatados + 1 ) if ( zombiesMatados == 1 ) then -- ACA DONDE DICE =1 pone la cantidad de zombies que tienen que matar para que aparesca if ( not isElement ( tyrant ) ) then tyrant = exports [ "slothbot" ]:spawnBot ( 249.1348, 1820.0046, 9, 90, 146, 0, 0, ex, 0, "hunting", true ) exports.extra_health:setElementExtraHealth ( tyrant, 20000 ) setGameSpeed ( tyrant, 5) outputChatBox ( "#ff0000Tyrant a Spawneado, Corre!", getRootElement(), 255, 255, 255, true ) onZomieWasted = 75 myBlip = createBlipAttachedTo ( tyrant, 23 ) end end end end addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", getRootElement(), zona2 ) function bot ( attacker ) if attacker == tyrant then --Creo que 'tyrant' es la variable de tu 'BOSS' killPed ( source, attacker ) end end addEventHandler("onPlayerDamage", getRootElement(), bot)
  18. @NOD getElementModel devuelve un int, no un string. local gMe = getLocalPlayer() function bot ( attacker ) if ( getElementType ( attacker ) == "ped" ) then local vida = getElementHealth(gMe) if ( vida >= 0 ) then killPed ( source ) end end end addEventHandler("onPlayerDamage", getRootElement(), bot) onPlayerDamage es server, killPed es server pero getLocalPlayer es client. y para no parecer criticon: function bot ( attacker ) if attacker == tyrant then --Creo que 'tyrant' es la variable de tu 'BOSS' killPed ( source, attacker ) end end addEventHandler("onPlayerDamage", getRootElement(), bot) PD: Si te da errores cuando un jugador se daña sin atacante, ponle una linea extra comprobando que si haya uno.
  19. Ups! error mio, ya lo corregí, hubiera sido catastrófico morir con eso puesto así..
  20. addEventHandler( "onPlayerWasted", root, function(ammo, attacker, weapon, bodypart) if attacker then setElementData(source, "Vidas", getElementData(source, "Vidas")-1) setElementData(attacker, "Vidas", getElementData(attacker, "Vidas")+1) else setElementData(source, "Vidas", getElementData(source, "Vidas")-2) end Vida = getElementData(source, "Vidas") if Vida < 0 then banPlayer(source, false, false, true, getRootElement ( ), "Fuiste baneado por quedarte sin vidas." ) end end ) Quizá tenia una vida, murió sin 'attacker' y su vida quedo en -1, lo que es distinto a 0. PD: Recuerda tener definido desde antes su vida, sino getElementData( source, "Vidas") seria 'false'.
  21. local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end Si te refieres a esas lineas, Lo único que hacen es eliminar los Team con una persona. Muchas personas lo quitan por que provoca ciertos errores en el debug o por que les elimina los team que ellos crearon y quitarlo no afectara lo que el esta pidiendo.
  22. Alexs

    [HELP] problem

    Maybe the player haven't fishes. addEventHandler("onMarkerHit", finish, function (thePlayer) if ( getElementType ( thePlayer)) == "player" then local fishes = getElementData( thePlayer, "fishes") or 0 outputChatBox ( "You have sold "..fishes.." fishes and earned #00FF00$"..fishes * 3,thePlayer) givePlayerMoney ( thePlayer,fishes* 3 ) setElementData ( thePlayer, "fishes", 0, false) end end )
  23. Si es que hablas del código del otro día: theObject = createObject ( 980, 439.10000610352, 945.5, 3.9000000953674) x,y,z = getElementPosition (theObject) Zona = createColSphere ( x, y, z, 7.5 ) --Como es mas realista, lo ajuste a una esfera de Diametro 15 function funcion (hitElement) if getElementType( hitElement ) == "player" then if getTeamName( getPlayerTeam( hitElement ) ) == "TU NOMBRE DE TEAM" then moveObject ( theObject, 10000, 430.29998779297, 937.29998779297, -1.9000000953674 ) end end end addEventHandler ( "onColShapeHit", Zona, funcion ) function funcion2 (hitElement) if getElementType( hitElement ) == "player" then if getTeamName( getPlayerTeam( hitElement ) ) == "TU NOMBRE DE TEAM" then moveObject ( theObject, 10000, 430.29998779297, 937.29998779297, 3.9000000953674 ) end end end addEventHandler ( "onColShapeLeave", Zona, funcion2 ) Si el código desde antes ya funcionaba, esto debería servir, pero te recomiendo probarlo bien y decirnos si hay algún problema en el código.
  24. Disculpa @NOD pero creo que es poco productivo que le digas 'ese script esta mal echo' sin decirle que hizo mal.
  25. x,y,z = getElemntPosition (theObject) Eso no existe y no te puedo decir que función usar si no se como manejas los clanes.
×
×
  • Create New...