Jump to content

MTA Skin shot?


Recommended Posts

Hello,

I am in a transition from SA:MP to MTA after I was blown out by MTA's advanced features. I am now trying to create a gamemode from scratch in order to learn lua, and I'm currently working on a deathmatch system. 

I have found a problem (for me), though: sometimes when I'm shooting a running target (and I hit them), the target doesn't always lose hp. Instead, I need to shoot behind that target (in a point where the target was positioned previously). I understand that this a sync issue, but is there a method to bypass this? Can I somehow trust the damager about the bullet sync, instead of the damaged player?

Here's a video to prove this:

 

In the video you can see how the targeted player makes the "damaged" animation, but he doesn't lose hp.

P.S: I have increased the FPS cap from the default (36 i think) to 60

Edited by Reachless
  • Like 1
Link to comment
  • 1 year later...
  • 4 weeks later...
  • Moderators
On 01/06/2018 at 19:38, Reachless said:

nstead, I need to shoot behind that target (in a point where the target was positioned previously). 

Hmm normally you would have to shoot in front of the target and not behind the target. Except when the target his fps is below the standards.

The player movement speed is based on fps. So that is why they do not recommend to put the max fps too high for PvP modus. MTA is correcting this by reupdate the position, but that is not enough for the exact position. This issue is hard to solve, even in modern games like battlefield and cod. But there they have serverside bullet detection, that solves partly the issue.

 

DO: exclude players with a too low fps OR reduce the max fps to something most machines can handle.

 

Increased sync works well with good internet, but has the opposite effect for players with bad internet.

 

With other words pick your target group for PvP or find a target group unlike yourself that doesn't mind lag.

 

 

 

 

 

  • Like 1
Link to comment
  • Scripting Moderators
2 hours ago, IIYAMA said:

Hmm normally you would have to shoot in front of the target and not behind the target. Except when the target his fps is below the standards.

The player movement speed is based on fps. So that is why they do not recommend to put the max fps too high for PvP modus. MTA is correcting this by reupdate the position, but that is not enough for the exact position. This issue is hard to solve, even in modern games like battlefield and cod. But there they have serverside bullet detection, that solves partly the issue.

 

DO: exclude players with a too low fps OR reduce the max fps to something most machines can handle.

 

Increased sync works well with good internet, but has the opposite effect for players with bad internet.

 

With other words pick your target group for PvP or find a target group unlike yourself that doesn't mind lag.

 

 

 

 

 

I've played on server which created some kind of own "bullet sync". I'm just curious how it could be done, server owner explained that attacker fully decides if victim was hit (victim got hit on attacker screen - probably ping was not that important factor). Honestly i don't think there is other way than using processLineOfSight + some other event, anyways i don't even know if that function is used for this, just wondering.

Link to comment
  • Moderators
31 minutes ago, majqq said:

I've played on server which created some kind of own "bullet sync". I'm just curious how it could be done, server owner explained that attacker fully decides if victim was hit (victim got hit on attacker screen - probably ping was not that important factor). Honestly i don't think there is other way than using processLineOfSight + some other event, anyways i don't even know if that function is used for this, just wondering.

It is more dirt than magic. ?

 

One of the first concepts of it was used in this headshot resource:

https://community.multitheftauto.com/index.php?p=resources&s=details&id=1600

It is really a disgusting concept... ?
 

 

function sendHeadshot ( attacker, weapon, bodypart, loss )

At first it looks innocent, but if you see this line, you know you kissed your opponent:

	if attacker == getLocalPlayer() then
		if bodypart == 9 then
			triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss )
			setElementHealth ( source, 0 )
			setPedHeadless( source, true )
		end
	end
end
addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot )
addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )

 

Edited by IIYAMA
Link to comment
  • Scripting Moderators
2 hours ago, IIYAMA said:

It is more dirt than magic. ?

 

One of the first concepts of it was used in this headshot resource:

https://community.multitheftauto.com/index.php?p=resources&s=details&id=1600

It is really a disgusting concept... ?
 

 


function sendHeadshot ( attacker, weapon, bodypart, loss )

At first it looks innocent, but if you see this line, you know you kissed your opponent:


	if attacker == getLocalPlayer() then

		if bodypart == 9 then
			triggerServerEvent( "onServerHeadshot", getRootElement(), source, attacker, weapon, loss )
			setElementHealth ( source, 0 )
			setPedHeadless( source, true )
		end
	end
end
addEventHandler ( "onClientPedDamage", getRootElement(), sendHeadshot )
addEventHandler ( "onClientPlayerDamage", getRootElement(), sendHeadshot )

 

I am not sure about that, server i'm talking about it's well done in almost every way, including PvP between players thanks to this "bullet sync", i think it's very complex feature. Atleast it looks like it is, honestly i wouldn't need such thing for my server, but i was everytime curious how it could be done. In my honest opinion, it's incomparable to others servers, maybe just one which have similar, but other in every aspect gamemode.

Developer of this server is very experienced, 6+ years of practise, he's contributing to MTA SA, and he's the one of person which was engaged in releasing 1.5.7 version.

Link to comment
  • Moderators
7 hours ago, majqq said:

Developer of this server is very experienced, 6+ years of practise, he's contributing to MTA SA, and he's the one of person which was engaged in releasing 1.5.7 version.

Does this person have a name?

Bigbadbutler/PhatLooser from chaos.de perhaps? Probably not, as he is not active any more. He indeed used processLineOfSight.

A player will 0.5k+ ping still manages to kill another player.

But never the less, it looks advanced, but it is still at the very bone, similar to the headshot resource. It is just way less enchanted, without overwrites.

 

Is the person you meant on this list?

 

 

Edited by IIYAMA
Link to comment
  • Scripting Moderators
41 minutes ago, IIYAMA said:

Does this person have a name?

Bigbadbutler/PhatLooser from chaos.de perhaps? Probably not, as he is not active any more. He indeed used processLineOfSight.

A player will 0.5k+ ping still manages to kill another player.

But never the less, it looks advanced, but it is still at the very bone, similar to the headshot resource. It is just way less enchanted, without overwrites.

 

Is the person you meant on this list?

 

 

Yeah, exactly. I'm talking about samr46. He develops DayZ server since 2013.

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