Variable resetting after player disconnect...
#1

Hi guys...

I have one question, should i use player variables like new PVARIABLE[MAX_PLAYERS] or this kind of variables https://sampwiki.blast.hk/wiki/SetPVarInt ?

I know that the variables like PVARIABLE[MAX_PLAYERS] are not resetting if the client crash, that kind of variables i'm resetting under OnPlayerDisconnect so if someone disconnects properly, his variables will return to 0, but if their sa-mp client crash the variables aren't resetting... So my final question is - Are this kind of variables ( https://sampwiki.blast.hk/wiki/SetPVarInt ) resetting automatically after player disconnects/crash ?
Reply
#2

This was originally posted by the sa-mp wiki
Quote:

Note: Variables aren't reset until after OnPlayerDisconnect is called, so the values are still accessible in OnPlayerDisconnect.

The same wiki page you posted read next time will ya.
Reply
#3

I do not recommend you to use PVars: https://sampforum.blast.hk/showthread.php?tid=268499

Variables (in your case the array) will be reset even if the player crashed. OnPlayerDisconnect is called so if you have:
pawn Код:
// OnPlayerDisconnect:
PVARIABLE[playerid] = 0;
it will be reset normally.
Reply
#4

Quote:
Originally Posted by Wizza
Посмотреть сообщение
This was originally posted by the sa-mp wiki The same wiki page you posted read next time will ya.
Man... my question was if the player crashes...

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I do not recommend you to use PVars: https://sampforum.blast.hk/showthread.php?tid=268499

Variables (in your case the array) will be reset even if the player crashed. OnPlayerDisconnect is called so if you have:
pawn Код:
// OnPlayerDisconnect:
PVARIABLE[playerid] = 0;
it will be reset normally.
TNX MAN... You really helped me to understand these things :P THANKS AGAIN... REP +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)