Jump to content

KaMi

Members
  • Posts

    155
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by KaMi

  1. local playerSelectedTarget local targetMarker = createMarker( 0, 0, 10000, "arrow", 1.5, 255, 0, 0 ) addEventHandler("onClientRender", root, function() if ( getKeyState("mouse2") == true ) then local x,y,z = getElementPosition(localPlayer) for k,target in ipairs(getElementsByType("player",root,true)) do if not ( target == localPlayer ) then local px,py,pz = getElementPosition(target) local distance = getDistanceBetweenPoints3D( px, py, pz, x, y, z ) if ( distance < 10 ) then --target distance playerSelectedTarget = target end end end if isElement(playerSelectedTarget) then local tx,ty,tz = getElementPosition(playerSelectedTarget) setElementPosition( targetMarker, tx, ty, tz+3 ) end else if isElement(playerSelectedTarget) then setElementPosition( targetMarker, 0, 0, 10000 ) end end end )
  2. KaMi

    [REL] The Red Zone

    SOLVED. Thank you for reply
  3. KaMi

    [REL] The Red Zone

    well, I realized the gamemode has a little bug so I decided to fix it and put some new things: Settings: <settings> <setting name="*RoundTime" value="[10]" /> <!-- Round Time ( Default: 10 mins ) --> <setting name="*Zombies" value="true" /> <!-- Enable Zombies? ( Default: true ) --> <setting name="*MinPlayers" value="[0]" /> <!-- Minimum players to play. If the value is 0, bots will spawn ( can cause some lag ) ( Default: 4 ) --> </settings> If the value of 'MinPlayers' is 0, Bot soldiers will spawn and the 'single player' mode will start. Bots: Bloodtox bomb ( a powerful toxin that can cause a great health loss in the prototype ) Double Impulse ( 'W' two times ):
  4. Hello ! i'm back again with my first gamemode based on [PROTOTYPE] and [PROTOTYPE2] games. The context is simple. A secret government agency ( called Black Watch ) has to fight against a guy with superhuman skills in a post-apocalyptic place called 'The Red Zone'. The Black Watch Team has three ranks: Trooper - Commander - Pilot. Each rank has its own skills and respective vehicles as the black watch team, the superhuman (Prototype) has a wide variety of skills, attacks and transformations Also during the course of the gamemode, certain events occur such as: Super Soldiers Airstrikes & Others. Note: this gm needs at least 4 players to run ( or you can also change it cause is an Open Source script ) Thx for your time . Download the resource here
  5. Resource special update. Look description.
  6. Intentá esto --CLIENT addEventHandler("onClientRender", root, function() -- Con esta función se tomará el interior del jugador constantemente. local int = getElementInterior(localPlayer) -- Se toma el interior del jugador. setElementData( localPlayer, "Interior", int ) -- El dato "Interior" guarda en que interior se encuentra el jugador. end ) addEventHandler("onClientElementDataChange", root, function(key,oV,nV)-- Esta función se iniciara cuando se detecte un cambio de interior por el jugador. if key == "Interior" then -- Detecta si el dato que cambia es "Interior". triggerServerEvent( "onPlayerInteriorWarped", source, oV, nV ) -- Inicia un evento enviado al lado del servidor donde source es el jugador que cambió de interior, oV es el antiguo interior y nV es el nuevo interior. end end ) --SERVER addEvent("onPlayerInteriorWarped", true) -- Añade el evento 'onPlayerInteriorWarped' al lado del servidor. addEventHandler("onPlayerInteriorWarped", root, function(oldInterior,newInterior) -- Tu función. if oldInterior == 0 then toggleControl( source, "fire", false ) elseif newInterior == 0 then toggleControl( source, "fire", true ) end end ) Si no funciona es porque capaz tenés algo mal en el meta porque el que te pasaron estaba perfecto.
  7. Amigo, tu código no tiene mucho sentido... Te daré una pequeña ayuda con este y después lo continuarás tú para que puedas aprender. --CLIENT addEventHandler("onClientRender", root, function() -- Con esta función se tomara el interior del jugador constantemente. local int = getElementInterior(localPlayer) -- Se toma el interior del jugador. setElementData( localPlayer, "Interior", int ) -- El dato "Interior" guarda en que interior se encuentra el jugador. end ) addEventHandler("onClientElementDataChange", root, function(key,oV,nV)-- Esta función se iniciara cuando se detecte un cambio de interior por el jugador. if key == "Interior" then -- Detecta si el dato que cambia es "Interior". triggerServerEvent( "onPlayerInteriorWarped", source, oV, nV ) -- Inicia un evento enviado al lado del servidor donde source es el jugador que cambió de interior, oV es el antiguo interior y nV es el nuevo interior. end end ) --SERVER SIDE addEvent("onPlayerInteriorWarped", true) -- Añade el evento 'onPlayerInteriorWarped' al lado del servidor. addEventHandler("onPlayerInteriorWarped", root, function(oldInterior,newInterior) -- Tu función. --TU CODIGO end ) Te aviso que no probé el script así que, si hay un error, dime. Mucha suerte
  8. ¿ Creaste la función que inicia el evento "onPlayerInteriorWarped" ? ¿ Si es así, podrías pasarlo ?
  9. In Game -> Admin Panel -> Resources -> Manage ACL -> Click on Admin -> Click on Add object in group -> Type "resource.resourceName" Example: resource.loginPanel
  10. They work... you must give admin rights to the resource.
  11. use: onClientPlayerDamage setElementData setTimer Example: --Not tested local timeEffect = 10000 addEventHandler("onClientPlayerDamage", getLocalPlayer(), function() if ( getElementData( source, "antiEscape" ) == false ) then setElementData( source, "antiEscape", true ) setTimer( setElementData, timeEffect, 1, source, "antiEscape", false ) end end ) --Your teleport code addCommandHandler("teleport", function() if ( getElementData( localPlayer, "antiEscape" ) == false ) then --teleport code else outputChatBox("You can't escape !" ) end end )
  12. triggerClientEvent -> SERVER SIDE ( Pass the player variable and the object ). setElementCollidableWith -> CLIENT SIDE.
  13. hmm i think you can use bindKey and setGameSpeed
  14. You can try this but i think there can be other forms. addEventHandler("onPlayerWeaponFire", root, function( weapon ) if weapon == 34 then --detect if weapon is sniper ( id 34 ). giveWeapon( source, 34, 1 ) -- faster weapon reload. end end )
  15. Scoreboard it's a default resource. You can stop it typing /stop scoreboard.
  16. Que onda gente ! Un día me harté de mi papa con cables así que decidí crear este simple sistema y compartirlo para todas aquellas personas que se hayan cansado de tirar su teclado por la ventana por algún bajón de FPS. La verdad es que este recurso ya lo había subido hace tiempo a la comunidad pero actualmente lo modifiqué un poco. DESCRIPCIÓN: El sistema trae 8 funciones que serán modificadas según el gusto del usuario. También, como detalle, trae un visor de FPS que lo agregué recientemente y funciona a base de la función útil getCurrentFPS. La gui la hice con el recurso GUI Editor ya que así me resultaba más fácil y rápido. Acá les voy a dejar algunas imágenes que muestran un poco su funcionamiento: IMÁGENES: El código está %100 descompilado pero les recomiendo no editar mucho los valores ya que el usuario podría recibir algún daño en su juego. Muchas gracias por su tiempo. Espero que les sirva !! -------------------------------------------------------------------------------------------> RESOURCE <---------------------------------------------------------------------------------------------
  17. Bien. Depende un poco de la resolución de tu imagen pero quizá funcione el código que te pasaré. local sW, sH = guiGetScreenSize()--Esto va afuera de todo. Sirve para tomar el tamaño de la pantalla. dxDrawImage((sW - 800) / 2, (sH - 600) / 2, 800, 600, "display.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) --Esto reemplazará tu otra función de 'dxDrawImage'.
  18. KaMi

    Warp player to

    source, posX, posY, posZ are null
  19. Si el meta te corrió el código significa que está bien. El problema es en el client en esta linea: dxDrawImage(10, 10, 48, 48, "img/display.png") Te olvidaste de eliminar el 'img/' ya que la imagen está suelta en tu archivo y no dentro de otra carpeta. Por lo tanto, tendría esa linea tendrás que reemplazarla por esta: dxDrawImage(10, 10, 48, 48, "display.png")
  20. Sí pero el archivo teleimage.lua tiene que estar del lado client. Si no me entendés, acá te dejo un ejemplo: <script src="teleimage.lua" type="client" />
  21. addEventHandler("onClientRender", root, function() if ( getElementData( localPlayer, "dibujarImagen" ) == true ) then dxDrawImage(10, 10, 48, 48, "img/display.png") end end ) local marker = createMarker(7147.4609375, -2186.1020507813, 3.7390625476837, "cylinder", 1.75, 255, 0, 0) function showimage(hit) if getElementType(hit) == "player" then if hit == getLocalPlayer() then --local name = getPlayerName(getLocalPlayer()) --if getPlayerName(hit) == name then setElementData( hit, "dibujarImagen", true ) end end end addEventHandler("onClientMarkerHit", marker, showimage ) function unShowImage(leave) if getElementType(leave) == "player" then if leave == getLocalPlayer() then setElementData( leave, "dibujarImagen", false ) end end end addEventHandler("onClientMarkerLeave", marker, unShowImage ) Tuviste algunos errores: 1- No pusiste los eventos ( Que son muy importantes para ejecutar la función ). 2- El tamaño del marker estaba mal. 3- La función dxDrawImage solo se muestran por 1 milisegundo, por lo tanto, podrías haber usado el evento onClientRender. 4- La función showimage no está cerrada. 5- Esta linea es innecesaria : local name = getPlayerName(getLocalPlayer()) if getPlayerName(hit) == name then El codigo no lo probé todavía pero creo que está bien y si no, me avisas por fa. Suerte
  22. Podrías postear el codigo para que podamos ayudarte ?
×
×
  • Create New...