#Dv^ Posted June 20, 2016 Posted June 20, 2016 Hola! Disculpen, que se usa para que al matar a alguien en la cabeza salga al chat esto addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then local result = triggerEvent("onPlayerHeadshot", source, attacker, weapon, loss) if result == true then outputChatBox("#2971D5[Headshot]#FFFFFF "..getPlayerName(attacker).." #FFFFFFle partió la cabeza a "..getPlayerName(source).." #FFFFFFha ganado#00FF00[+$1000]", root,0,255,0,true) killPlayer(source, attacker, weapon, bodypart) end end end ) :b
Tomas Posted June 20, 2016 Posted June 20, 2016 ¿A qué te refieres? Currently developing for International Gaming Community - Join us!
#Dv^ Posted June 20, 2016 Author Posted June 20, 2016 Me sale el error que killPlayer ya no se usa en estas futuras versiones Osea cuando alguien te da un disparo en la cabeza sale el mensaje que te mato de un headshot pero no sale :b
Castillo Posted June 20, 2016 Posted June 20, 2016 Usa killPed. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Mr.Aleks Posted June 20, 2016 Posted June 20, 2016 El error ese es porque debes usar killPed. De todas formas revisa tu función o pon el código completo. Some opportunities come once in a lifetime Skype: alex.migliore1
#Dv^ Posted June 20, 2016 Author Posted June 20, 2016 Aún así no sale el mensaje, yo creo que para killPed es para cuando un "Ped" te mata pero no sirve para un Player :b
Castillo Posted June 20, 2016 Posted June 20, 2016 Si sabes mas que los que te intentan ayudar, entonces para que pedis ayuda? killPed es para ambos. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Mr.Aleks Posted June 21, 2016 Posted June 21, 2016 Postea el código completo. Some opportunities come once in a lifetime Skype: alex.migliore1
PDMTA Posted June 23, 2016 Posted June 23, 2016 Se entiende que Ped es un skin sea hecho con el map editor, script o spawn. Servidor Guerra Latina Servidor Gang War 90% en progreso. Volviendo al scripting.
aka Blue Posted June 23, 2016 Posted June 23, 2016 En la wiki te lo deja de maravilla, solo cambia el output por lo que quieras poner... --add an event handler for the onPlayerDamage event function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged if ( bodypart == 9 ) then -- if the body part is 9, i.e. the head outputChatBox ( "Headshot!", getRootElement (), 255, 170, 0 ) --output "Headshot" into the chatbox killPed ( source, attacker, weapon, bodypart ) -- and kill the player end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text )
#Dv^ Posted June 24, 2016 Author Posted June 24, 2016 Si ya lo usé en el de la Wiki y me funciona perfecto, pero si quiero que solo con la Sniper sea el HeadShot y no con otras armas? :b
DBY Posted June 24, 2016 Posted June 24, 2016 Usa una condicional con getPedWeapon y compara si el arma que tiene el atacante es el ID 34 (Sniper) YT Channel
Recommended Posts