Jump to content

Ayuden con estoy soy nuevo ando un poco perdido


abelito

Recommended Posts

function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged
	if ( bodypart == 9 and attacker and attacker ~= source ) then -- if the body part is 9 (head) and there is an attacker and it wasn't self damage
            outputChatBox ( "Headshot!", attacker, 255, 170, 0 ) --output "Headshot" into the chatbox
	    killPed ( source, attacker, weapon, bodypart ) -- and kill the player
	end
end
addEventHandler ( "onPlayerDamage", root, playerDamage_text ) --add an event handler for the onPlayerDamage event
Link to comment
  • Scripting Moderators

Hi, welcome to the forums! ?

Your thread has been moved to the Spanish scripting section so you can get better help in your native language.
Make sure to always use English when posting outside this language-specific section!

  • Like 1
Link to comment

Tu script no parece contener ningún error aparente en cuanto a sintaxis, y en teoría debería funcionar correctamente. La función "playerDamage_text" se activará cada vez que un jugador reciba daño, y si el daño fue infligido en la cabeza por otro jugador, se mostrará un mensaje "Headshot" en el chat y se matará al jugador.

Debes ser más específico sobre si tienes algún problema o error que estés experimentando para poder ayudarte.

Siempre puedes preguntar en la sección "es-scripting" en el servidor de Discord MTA para obtener ayuda.

Edited by Fonz
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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