StanMarsh Posted June 7, 2013 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? En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
NodZen Posted June 7, 2013 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) ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
StanMarsh Posted June 7, 2013 Author 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? En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
NodZen Posted June 7, 2013 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. ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
StanMarsh Posted June 8, 2013 Author Posted June 8, 2013 ??? En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
Castillo Posted June 8, 2013 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". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
FraN-724 Posted June 8, 2013 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)
Castillo Posted June 8, 2013 Posted June 8, 2013 killPed es server side, onClientPedDamage client side. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
StanMarsh Posted June 8, 2013 Author Posted June 8, 2013 killPed es server side, onClientPedDamage client side. Entonces que hago? En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
Castillo Posted June 8, 2013 Posted June 8, 2013 Usa triggerServerEvent. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
StanMarsh Posted June 8, 2013 Author Posted June 8, 2013 Usa triggerServerEvent. Pero Como se usa jamas he usado el triggerServerEvent y en la wiki no entendi En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
Castillo Posted June 8, 2013 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
FraN-724 Posted June 8, 2013 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)
NodZen Posted June 8, 2013 Posted June 8, 2013 La verdad no me acordé de ese eveto ------------------------------------------------------------------------------------------ My scripts http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977 http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740
StanMarsh Posted June 8, 2013 Author 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? En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
StanMarsh Posted June 8, 2013 Author 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 En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
StanMarsh Posted June 8, 2013 Author Posted June 8, 2013 Entonces prueba con el script que te dio Solid. Probe y nada :I En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
FraN-724 Posted June 8, 2013 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 )
Castillo Posted June 8, 2013 Posted June 8, 2013 Entonces prueba con el script que te dio Solid. Probe y nada :I Postea el meta.xml. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
StanMarsh Posted June 8, 2013 Author Posted June 8, 2013 En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
Recommended Posts