Jump to content

Rocket kill


DarkByte

Recommended Posts

I have fixed this bug. To get my fix you need to go to your resources folder of the server then go into [gameplay] folder then into killmessages folder and open killmessages_server.lua and then copy all of this: https://raw.githubusercontent.com/multitheftauto/mtasa-resources/0c3abe578c8f49d18d765dd21b96693f0b153654/[gameplay]/killmessages/killmessages_server.lua

Remove all text in killmessages_server.lua then paste this new text into it. If the server is running do: restart killmessages

All vehicle kills and rocket kills should appear correctly.

Link to comment
3 hours ago, DarkByte said:

It's working, but I've achieved that earlier. The thing i want is: if the victim is in vehicle to get the weapon which vehicle got blown by....but in this version it shows that the player killed himself not killed by a player

That is a good idea. We would need to store the last damager and the weapon used when vehicles are attacked, however onVehicleDamage doesn't give us these parameters meaning we'd need to use onClientVehicleDamage and by that point the whole thing would be too impractical for me to commit to the official killmessages resource.

However you could do this for yourself. I'd recommend handling onClientPlayerWasted, basically move that function to client side and then onClientVehicleDamage would be more practical, in fact I don't even know why official killmessages has that code server side because the whole thing can be done client side. I actually moved that main function client side for my server.

Link to comment

I've been searching and found this script. I tried to implement it in killmessages but failed, maybe you can help me?

addEventHandler("onPlayerDamage", root,
	function(attacker, attackerWeapon, bodyPart, loss)
		-- Last Attacker
		if (isElement(attacker) and getElementType(attacker) == "vehicle") then
			-- Get Driver for Vehicle Attackers
			attacker = getVehicleOccupant(attacker)
			--outputChatBox(getPlayerName(attacker))
		end
		lastAttacker[source] = attacker or false
		lastAttackerWeapon[source] = attackerWeapon or false
		lastDMG[source] = math.floor(loss)
		if (lastAttacker[source]) then
			lastVictim[attacker] = source
			lastAttack[attacker] = getTickCount()
		end
	end
)

 

Link to comment
11 hours ago, DarkByte said:

I've been searching and found this script. I tried to implement it in killmessages but failed, maybe you can help me?


addEventHandler("onPlayerDamage", root,
	function(attacker, attackerWeapon, bodyPart, loss)

 

onPlayerDamage doesn't have those parameters that's why I told you, you can't do it server side.

Edited by Arran
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...