[MySQL]Player Spawn info not saving
#7

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(playeridreason)
{
    
MySQLRaceCheck[playerid]++;
    
PlayerAccountUpdate(playeridreason);
    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.
Reply


Messages In This Thread
[MySQL]Player Spawn info not saving - by princejeet1510 - 28.01.2017, 16:35
Re: [MySQL]Player Spawn info not saving - by princejeet1510 - 28.01.2017, 18:14
Re: [MySQL]Player Spawn info not saving - by IceCube! - 28.01.2017, 18:46
Re: [MySQL]Player Spawn info not saving - by princejeet1510 - 29.01.2017, 04:46
Re: [MySQL]Player Spawn info not saving - by AjaxM - 29.01.2017, 07:41
Re: [MySQL]Player Spawn info not saving - by princejeet1510 - 29.01.2017, 08:11
Re: [MySQL]Player Spawn info not saving - by AjaxM - 29.01.2017, 08:26
Re: [MySQL]Player Spawn info not saving - by princejeet1510 - 29.01.2017, 08:59

Forum Jump:


Users browsing this thread: 1 Guest(s)