Jump to content

Rocket kill


DarkByte

Recommended Posts

Posted

Hello. Since the default killmessages won't show how to get the killer if you're in a vehicle. I mean if you're in a vehicle and someone shoots a rocket/hs rocket/hydra rocket or tank it show that you killed yourself. Can someone give me some advices?

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

Bump

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

Ok, thanks for reply. But How to get the one who created projectile? I know it's getProjectileCreator, but how to implement it in killmessages..

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted (edited)
30 minutes ago, DarkByte said:

Ok, thanks for reply. But How to get the one who created projectile? I know it's getProjectileCreator, but how to implement it in killmessages..

https://wiki.multitheftauto.com/wiki/Projectiles

58  Flare from hydra (doesn't work)

Edited by ViRuZGamiing

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

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.

Posted

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

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
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.

Posted

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
)

 

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

Help!

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

I want to make it serversided, and need some halp :D
HB btw

  • Like 1

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted (edited)
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
Posted

Then how the shooter gamemode gets the killer?

 

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

I've tried onClientVehicleDamage, but it doesn't detect the rocket.

 

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

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...