Jump to content

Tengo Una Duda...


Recommended Posts

Hola, Tengo una duda ase poco no tenia internet y comense a aser un script y ise un laser que lo cambia por la katana y con los sonidos todo eso iva bien pero me llego una duda de como aser que solo la katana al darte en un lugar del cuerpo ej:Torso que te quite toda la vida que tengas. se podria haser eso?

Link to comment

Podrias usar algo así

function healthP ( attacker, weapon, bodypart, loss ) 
     if getElementType ( attacker ) == "player"  and weapon == 8 then 
         killPed ( source ) 
         outputChatBox("Estás muerto...", source, 255, 0, 0, 0, false) 
     end 
end 
addEventHandler("onPlayerDamage", getRootElement(), healthP) 
Link to comment
Podrias usar algo así

function healthP ( attacker, weapon, bodypart, loss ) 
     if getElementType ( attacker ) == "player"  and weapon == 8 then 
         killPed ( source ) 
         outputChatBox("Estás muerto...", source, 255, 0, 0, 0, false) 
     end 
end 
addEventHandler("onPlayerDamage", getRootElement(), healthP) 

Serviria Tambien que al atacar a un zombie el zombie muera?

Link to comment
Podrias usar algo así

function healthP ( attacker, weapon, bodypart, loss ) 
     if getElementType ( attacker ) == "player"  and weapon == 8 then 
         killPed ( source ) 
         outputChatBox("Estás muerto...", source, 255, 0, 0, 0, false) 
     end 
end 
addEventHandler("onPlayerDamage", getRootElement(), healthP) 

Serviria Tambien que al atacar a un zombie el zombie muera?

No, tendrias que hacér otro. Talvéz con un loop para los peds.

Link to comment
Podrias usar algo así

function healthP ( attacker, weapon, bodypart, loss ) 
     if getElementType ( attacker ) == "player"  and weapon == 8 then 
         killPed ( source ) 
         outputChatBox("Estás muerto...", source, 255, 0, 0, 0, false) 
     end 
end 
addEventHandler("onPlayerDamage", getRootElement(), healthP) 

Serviria Tambien que al atacar a un zombie el zombie muera?

No, tendrias que hacér otro. Talvéz con un loop para los peds.

Un loop? para que? puede usar "onClientPedDamage".

Link to comment

No estoy muy seguro de esto, no lo tengo testeado

function healthP ( attacker, weapon, bodypart, loss ) 
    if (getElementType( attacker ) == "ped") and weapon == 8 then 
        killPed ( source ) 
        outputChatBox("Estás muerto...", source, 255, 0, 0, false) 
     end 
end 
addEventHandler("onClientPedDamage", getRootElement(), healthP) 

Link to comment

-- client side:

function healthP ( attacker, weapon, bodypart, loss ) 
    if ( attacker and getElementType ( attacker ) == "ped" and weapon == 8 ) then 
        triggerServerEvent ( "killZombie", localPlayer, source ) 
    end 
end 
addEventHandler ( "onClientPedDamage", getRootElement(), healthP ) 

-- server side:

addEvent ( "killZombie", true ) 
addEventHandler ( "killZombie", root, 
    function ( zombie ) 
        killPed ( zombie ) 
    end 
) 

Link to comment

Oh verdad, no me habia dado cuenta, quizás esto le podria servir ahora enves de mandar trigger

function healthP ( attacker, weapon, bodypart, loss ) 
    if (getElementType( attacker ) == "ped") and weapon == 8 then 
        setElementHealth(source, 0) 
        outputChatBox("Estás muerto...", source, 255, 0, 0, false) 
     end 
end 
addEventHandler("onClientPedDamage", getRootElement(), healthP) 

Link to comment
Oh verdad, no me habia dado cuenta, quizás esto le podria servir ahora enves de mandar trigger
function healthP ( attacker, weapon, bodypart, loss ) 
    if (getElementType( attacker ) == "ped") and weapon == 8 then 
        setElementHealth(source, 0) 
        outputChatBox("Estás muerto...", source, 255, 0, 0, false) 
     end 
end 
addEventHandler("onClientPedDamage", getRootElement(), healthP) 

En que lugar esta para ubicar a donde hay que darle al zombi?

Link to comment

Intenta esto

-- Client

function healthP ( attacker, weapon, bodypart, loss ) 
    if (getElementType ( attacker ) == "ped" and weapon == 8 ) then 
        triggerServerEvent ( "killZombie", localPlayer, source ) 
    end 
end 
addEventHandler ( "onClientPedDamage", getRootElement(), healthP ) 

-- Server

addEvent ( "killZombie", true ) 
addEventHandler ( "killZombie", root, 
    function ( zombie ) 
        killPed ( zombie ) 
        outputChatBox("Estás muerto...", source, 255, 0, 0, false) 
    end 
) 

Link to comment
  • Recently Browsing   0 members

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