OnPlayerDisconnect FS or GM?
#1

I've just joined the scripting community and got a technical question:

When OnPlayerDisconnect is initiated, is it first initiated in the filterscript or gamemode?
I wish to create a pvar that will change in the "OnPlayerDisconnect" callback inside the filterscript, and will be used in the "OnPlayerDisconnect" inside the gamemode.
Will it work? And if so, I assume I must return 0 in the filterscript right?

Thanks in advance!
Reply
#2

If you're creating a Filterscript, use the FS's OnPlayerDisconnect.
If you're using a Gamemode, use it's OnPlayerDisconnect.
You can't use a gamemodes callback for a filterscripts function.
Reply
#3

What I'm trying to accomplish is a pVar that will update as soon as the player leaves in my admin commands filterscript (it will be set to 1 if the player left during an admin freeze or jail) and then it will be saved to the player file. The saving mechanism (Y_INI) is inside the GM script in it's "OnPlayerDisconnect".

So basically as soon as the player leaves, it will change and be saved together with the other stats like money etc.

Is there any other way of doing it? Or will I need 2 saving mechanisms, 1 for each script?

By the way, the reason I want it to update when the player is leaving, is so I won't be using pVars updates so often. I don't want the code to run slow by changing the pVar each time a player is frozen/jailed etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)