Jump to content

[ayuda] como seria un script qe al morir se te salga el juego ? gracias


Ratasauria

Recommended Posts

si gracias , pero estaba buscando PARA QUE SE LE SALGA EL JUEGO CUANDO MUERE 

nose el script amigo

 

o que se utilizaria

onplayerdead()

quit ¿?

end

 

necesito el codigo amigo :'

if ( killer and isElement(killer) and getElementType ( killer ) == "player" ) then

exittt este codigo necesito :v

7 hours ago, CastiaL said:

UNA CONSULTA BRO estos codigo son como nodejs no ? yo algo entiendo de nodejs

Link to comment

Los códigos Lua están cerca de nodejs

 

-- 1. Example
addEventHandler( "onPlayerWasted", root,
	function()
    	player = source -- player
    	playerName = getPlayerName(player) -- player Name
		outputChatBox(playerName.." ha muerto!", resourceRoot, 255, 0, 0, true) -- 255, 0 , 0 = rojo, verde, azul
	end
)

-- 2. Example
function player_Wasted ( ammo, attacker, weapon, bodypart )
	-- if there was an attacker
	if ( attacker ) then
		-- we declare our variable outside the following checks
		local tempString
		-- if the element that killed him was a player,
		if ( getElementType ( attacker ) == "player" ) then
			-- put the attacker, victim and weapon info in the string
			tempString = getPlayerName ( attacker ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"
		-- else, if it was a vehicle,
		elseif ( getElementType ( attacker ) == "vehicle" ) then
			-- we'll get the name from the attacker vehicle's driver
			tempString = getPlayerName ( getVehicleController ( attacker ) ).." killed "..getPlayerName ( source ).." ("..getWeaponNameFromID ( weapon )..")"
		end
		-- if the victim was shot in the head, append a special message
		if ( bodypart == 9 ) then
			tempString = tempString.." (HEADSHOT!)"
		-- else, just append the bodypart name
		else
			tempString = tempString.." ("..getBodyPartName ( bodypart )..")"
		end
		-- display the message
		outputChatBox ( tempString )
	-- if there was no attacker,
	else
		-- output a death message without attacker info
		outputChatBox ( getPlayerName ( source ).." died. ("..getWeaponNameFromID ( weapon )..") ("..getBodyPartName ( bodypart )..")" )
	end
end
addEventHandler ( "onPlayerWasted", root, player_Wasted )


Si escribe qué hacer cuando el jugador muere, puedo ayudar.

Desde la derecha, estaría muy feliz si le agrado. :)

Edited by CastiaL
  • Like 1
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...