Bug OnPlayerTakeDamage and Lag?
#1

Hi, i have a problem on my callback OnPlayerTakeDamage my player report me to see sometimes 0 damage on textdraw (it's showed when the player hit other player).

I use a log for check if it's an bug and i see this message:

Quote:

UJia dmg check WP:54 PHit:Kowayt DMG:0.00 Body:3.
Slayer dmg check WP:0 PHit:Warteka. DMG:0.00 Body:5

there are not just them report on my log, i don't understand how i can have this bug.

2)

I don't understand when my player are together on an interior example i have an important lag, i try to remove plugin and other but it's not a problem of object, i don't use labelplayer and other. What can be cause this bug?
Reply
#2

1)

Do you use correctly the callback ?

Means do you use floatsub() to take life from the damaged player ?
You can't substract floats with a simple -.

2)

The only case to solve the problem is to buy a more powerful server.
Reply
#3

OnPlayerTakeDamage was called even if the damage was 0 in 0.3x (probably in 0.3e as well). I guess the damage is too low such as 0.1 for example and because of the problem with the floats, it might goes 0.09 which is basically 0.

You can avoid it by checking the value of the damage:
pawn Код:
if (amount) // not 0.0
{
    // code..
}
I'm not aware of your second problem though.
Reply
#4

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
1)
Means do you use floatsub() to take life from the damaged player ?
You can't substract floats with a simple -.
Unless you meddled in float.inc and deleted some stuff, using the standard operators works perfectly fine. The operators are overloaded to call their respective functions.
Reply
#5

No i don't use a function for this log i return the values of the callback OnPlayerTakeDamage, it's strange why ID 54 is called with not INVALID_ID issuerid with 0 damage.

You think the problem it's my server for my 2nd problem?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)