StanMarsh Posted June 7, 2013 Share Posted June 7, 2013 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
NodZen Posted June 7, 2013 Share Posted June 7, 2013 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
StanMarsh Posted June 7, 2013 Author Share Posted June 7, 2013 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
NodZen Posted June 7, 2013 Share Posted June 7, 2013 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
Castillo Posted June 8, 2013 Share Posted June 8, 2013 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
FraN-724 Posted June 8, 2013 Share Posted June 8, 2013 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
Castillo Posted June 8, 2013 Share Posted June 8, 2013 killPed es server side, onClientPedDamage client side. Link to comment
StanMarsh Posted June 8, 2013 Author Share Posted June 8, 2013 killPed es server side, onClientPedDamage client side. Entonces que hago? Link to comment
StanMarsh Posted June 8, 2013 Author Share Posted June 8, 2013 Usa triggerServerEvent. Pero Como se usa jamas he usado el triggerServerEvent y en la wiki no entendi Link to comment
Castillo Posted June 8, 2013 Share Posted June 8, 2013 -- 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
FraN-724 Posted June 8, 2013 Share Posted June 8, 2013 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
NodZen Posted June 8, 2013 Share Posted June 8, 2013 La verdad no me acordé de ese eveto Link to comment
StanMarsh Posted June 8, 2013 Author Share Posted June 8, 2013 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
FraN-724 Posted June 8, 2013 Share Posted June 8, 2013 Solo tendrías que matarlo con la arma 8 y ya Link to comment
StanMarsh Posted June 8, 2013 Author Share Posted June 8, 2013 Solo tendrías que matarlo con la arma 8 y ya le doy con el arma 8 y no le pasa nada al zombie Link to comment
FraN-724 Posted June 8, 2013 Share Posted June 8, 2013 Entonces prueba con el script que te dio Solid. Link to comment
StanMarsh Posted June 8, 2013 Author Share Posted June 8, 2013 Entonces prueba con el script que te dio Solid. Probe y nada :I Link to comment
FraN-724 Posted June 8, 2013 Share Posted June 8, 2013 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
Castillo Posted June 8, 2013 Share Posted June 8, 2013 Entonces prueba con el script que te dio Solid. Probe y nada :I Postea el meta.xml. Link to comment
FraN-724 Posted June 8, 2013 Share Posted June 8, 2013 Esta mal, remplaza este por el otro Link to comment
Recommended Posts