Quote:
Originally Posted by princejeet1510
well is it really not important to check something..onplayerdisconnect
like if 1 player disconnect and then another player join with same playerid his data will be transferred to him...
correct me if i'm wrong..
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
MySQLRaceCheck[playerid]++;
PlayerAccountUpdate(playerid, reason);
if(cache_is_valid(PINFO[playerid][Cache_ID]))
{
cache_delete(PINFO[playerid][Cache_ID]);
PINFO[playerid][Cache_ID] = MYSQL_INVALID_CACHE;
}
if (PINFO[playerid][LoginTimer])
{
KillTimer(PINFO[playerid][LoginTimer]);
PINFO[playerid][LoginTimer] = 0;
}
PINFO[playerid][Plogged] = false;
return 1;
}
BTW I don't have to create Cache_ID in database right?
|
1st: Yes, it does happen. That's why i killed the timer when the player disconnected so that the disconnected player's position variable don't get transferred to the player joined with the same ID.
2nd: The ID is the primary key to store all the records unique and avoid data from dublicating. Yes, you should create the ID.