Small error
#5

Are you logging them in with their IP address? Here try this.

Be sure to reset all stats when they disconnect, it will prevent other players who connect with the previous ID to capture those stats.

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    if(
Logged[playerid] == 1)
    {
        for(new 
ipInfo:pInfoi++) pData[playerid][pInfo:i] = 0;
        
Logged[playerid] = 0;
    }
    return 
1;

Change pInfo to your enum thing.

Assuming you're using Whirlpool. So try this

PHP код:
forward OnAccountLoad(playerid, const password[]);
public 
OnAccountLoad(playerid, const password[])
{
   new 
ppassword[500], hashedpass[500],  registerdate;
    
WP_Hash(hashedpasssizeof(hashedpass), mysql);
    
cache_get_field_content(0"Password"ppasswordmysql);
    
cache_get_field_content(0"RegisterDate"registerdatemysql);
    
    if(!
strcmp(hashedpassppassword))
    {
        if(
Logged[playerid] != 1)
        {
            
pData[playerid][Admin] = cache_get_field_content_int(0"Admin");
            
pData[playerid][VIP] = cache_get_field_content_int(0"VIP");
            
GivePlayerCash(playeridcache_get_field_content_int(0"Money"));
            
SetPlayerScore(playeridcache_get_field_content_int(0"Score"));
            
pData[playerid][Deaths] = cache_get_field_content_int(0"Deaths");
            
pData[playerid][MissionsPlayed] = cache_get_field_content_int(0"MissionsPlayed");
            
pData[playerid][VipTime] = cache_get_field_content_int(0"VipTime");
            
pData[playerid][Warns] = cache_get_field_content_int(0"Warns");
            
pData[playerid][Cookies] = cache_get_field_content_int(0"Cookies");
            
pData[playerid][Jailed] = cache_get_field_content_int(0"Jailed");
            
pData[playerid][Muted] = cache_get_field_content_int(0"Muted");
            
pData[playerid][Duty] = cache_get_field_content_int(0"Duty");
            
pData[playerid][Nopm] = cache_get_field_content_int(0"Nopm");
             
pData[playerid][RegisterDate] = registerdate;
            
CheckVipTime(playerid);
            
Logged[playerid] = 1;
            
            
SendClientMessage(playerid,red,"------------------------------------------------------");
            new    
playername3[MAX_PLAYER_NAME];
            
GetPlayerName(playeridplayername3sizeof(playername3));
            new 
string[128];
            
format(string,sizeof(string),"* System: Welcome back {F70505}%s (%d) {FFFFFF} - Your stats have been restored.",playername3,playerid);
            
SCM(playerid,-1,string);
            
SendClientMessage(playerid,red,"------------------------------------------------------");
        }
    }
    else 
ShowPlayerDialog(playeriddLOGINDIALOG_STYLE_INPUT"Login""In order to play, you need to login""Login""Quit");
    return 
1;

I've edited your check to see if they're registered or not.

PHP код:
forward OnAccountCheck(playerid);
public 
OnAccountCheck(playerid)
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsmysql);
    if(
rows)
    {
        
ShowPlayerDialog(playeriddLOGINDIALOG_STYLE_INPUT"Login""In order to play, you need to login""Login""Quit");
    }
    else
    {
        
ShowPlayerDialog(playeriddREGISTERDIALOG_STYLE_INPUT"Register""In order to play, you need to register.""Register""Quit");
    }
    return 
1;

I've changed some of your functions so if you get errors just reply with error and the lines. And me or somebody will help you. I didn't really understand why half of the variables were in your OnAccountCheck so if it doesnt work properly you'll have to put them back in.
Reply


Messages In This Thread
Small error - by Face9000 - 27.09.2015, 09:21
Re: Small error - by itsCody - 27.09.2015, 09:34
Re: Small error - by Face9000 - 27.09.2015, 10:06
Re: Small error - by Face9000 - 27.09.2015, 21:07
Re: Small error - by itsCody - 27.09.2015, 21:53

Forum Jump:


Users browsing this thread: 1 Guest(s)