Jump to content

Matar con Knife


Serginix

Recommended Posts

Posted

Hola, recientemente e visot algo q me jode mucho, y esq se pasan matando con el Knife por la Espalda, queria saber si habia algun modo Efectivo de quitarlo, intente con varios Eventos q involucraban el Knife (weapon ID 4) los cuales eran la utilizacion de cancelEvent() con:

--onClientPlayerDamage --> Evitar que mate/ataque

--onClientPlayerWasted --> Evitar que mate

--onClientPlayerTarget --> Evitar que apunte

--onClientPlayerWeaponSwitch --> Evitart q apunte

Todos estos sin exito, la verdad No tengo idea cual es el evento adecuado para cancelar la funciopn de asesinar por detras, quitaria el o cancelaria su uso total, pero... es mejor solo remover el daño por la espalda...

si alguien a hecho algo parecido o sabe como ahcerlo le agradeceria mucho la ayuda.

Posted

Muy fácil, "mi querido amigo".

https://wiki.multitheftauto.com/wiki/FindRotation <-- Copia el source.

addEventHandler ( "onClientPlayerTarget", getLocalPlayer ( ), 
function ( e )  
if getElementType ( e ) == "player" then 
    local x1, y1 = getElementRotation ( source ) 
    local x2, y2 = getElementRotation ( e ) 
    if math.abs(findRotation ( x1, y1, x2, y2 )) > 90 then toggleControl ( "fire", false ) end 
end 
end) 
addEventHandler ( "onClientKey", getLocalPlayer ( ), 
function ( key, state ) 
    if key == getKeyBoundToCommand ( "aim_weapon" ) and state == false then toggleControl ( "fire", true ) end 
end ) 

Posted

:o... jamas habria pensado en "findRotation"...

Aun no asi, no funciono (si si, obvio q lo puse en client side ¬¬), el debug me saca el error en getElementType solo con un "Bad Argument", tratare de solucionarlo.

Gracias...

Posted

Lo que queres desactivar son las stealth kills con el chuchillo? si es asi, intenta con esto:

addEventHandler("onClientPlayerStealthKill", localPlayer, 
function () 
    if (getPedWeapon(source) == 4) then 
          cancelEvent() 
    end 
end) 

Posted

Lol, si de la manera de SolidSnake funciono, no habia caido en eso de stealth kills, buee, solucionado gracias, =P

pueden cerrar el topic si desean, unavez mas Gracias a ambos.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...