View Single Post
Author Message
Sarrus
Member
Join Date: May 2020
Location: France
Old 06-01-2020 , 10:50   Can't safely delete a timer handle
Reply With Quote #1

Hello,

I've ran into a problem with a plugin I've made:
I have various per client timers which get deleted when a client dies. However, one of the timer is a repeating timer which, when fired, slaps the client with a certain amount of damages. Sometimes, this causes the client to die, and therefore, the timer gets deleted in the callback, which is a big no, and thus registers an error.

What I've tried so far to fix this, is to add a boolean bIsClientBeingPunished, which prevents the timer from being deleted, if it's true. The idea was that the timer would fire again, and stop itself, because the player was no longer alive. This doesn't work, and I'm not sure why.

Can somebody please help me?
Here is the script
__________________
Discord Coding Server | Steam Profile | Community Website | Github Profile

Taking paid requests (add me on Discord)
Sarrus is offline