Posts: 920
Threads: 113
Joined: Nov 2009
Reputation:
0
This callback does not detect explosion damage. In order to disable OnPlayerTakeDamage i have set all players to the same team, somehow i need to add grenades into OnPlayerTakeDamage as an exception and take damage even if all the players are in the same team. I use SetPlayerTeam.
Posts: 920
Threads: 113
Joined: Nov 2009
Reputation:
0
Thing is, when 2 players are on the same team they dont recieve any damage from each others, so i dont think that callback is the way to go..
btw gTeam should compare like != and not == because i dont want teamplayers to kill eachothers
Posts: 1,317
Threads: 23
Joined: Feb 2010
Reputation:
0
I'm not sure if I understand what you mean. The example posted by RoXor will not work because the damage is never registered (the player will not take damage). Why doesn't OnPlayerGiveDamage work for this?
On a side note, stop bumping your topic so much, I know your eager to get help but you're not the only one, and we don't get paid to help you. Have some patience.
Posts: 920
Threads: 113
Joined: Nov 2009
Reputation:
0
well it seems like OnPlayerGiveDamage doesnt register explosion damage.
Posts: 920
Threads: 113
Joined: Nov 2009
Reputation:
0
OnPlayerTakeDamage Does register damage even if he is in the same team, but it restores automatically i guess. If you withdraw the damaged amount manually within the script it should work. So Roxor's theory probably works, thanks. +Rep.
Posts: 1,317
Threads: 23
Joined: Feb 2010
Reputation:
0
Well, yeah, it makes sense GiveDamage doesn't register it as the game is probably more of a deal forget system. The grenade is thrown and damage is dealt, who threw it is unknown. TakeDamage should indeed work, I forgot it gets called whenever the player takes damage no matter what the cause is. However it depends how the team system works in samp, the no damage to friendlies is native so it can very well be that the damage is just never processed instead of set to old health.