OnPlayerDisconnect
#1

Welcome. I have a question related to "OnPlayerDisconnect".
In cases of withdrawal of a problem with the game "OnPlayerDisconnect" is triggered immediately, but within 5-10 seconds.
PHP код:
#include <a_samp>
main() { }
public 
OnGameModeInit() return true;
public 
OnPlayerConnect(playerid) return printf("OnPlayerConnect: %d"playerid);
public 
OnPlayerDisconnect(playeridreason) return printf("OnPlayerDisconnect: %d"playerid); 
When connecting "OnPlayerConnect ID" is displayed instantly.
When you exit the game [/q(uit)] similarly, in an instant.
But when removing the task is not a small delay, you can check for yourself.
I need to reset the variables, is it wise to update them in "OnPlayerConnect"?
Reply
#2

What is up with people posting questions like this? All weirdly styled and everything.

You can update variables in onPlayerDisconnect as it is called right before a player quits. However, if the reason is a crash or timeout, your variables might return wrong values.

Resetting variables to a starting value without saving it, is perfectly fine in OnPlayerConnect.
Reply
#3

.Th.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)