Whats wrong?
#2

You didn't look for data in the first place.

Use
pawn Код:
cache_get_data
pawn Код:
public OnAccountLoad(playerid)
{
    new score;
    new rows, fields;
    cache_get_data(rows, fields, Connection)//Connection is your DB connection
    if(rows)
    {
     pData[playerid][Admin] = cache_get_field_content_int(0, "Admin");
     pData[playerid][VIP] = cache_get_field_content_int(0, "VIP");
     pData[playerid][Money] = cache_get_field_content_int(0, "Money");
     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] = cache_get_field_content_int(0, "RegisterDate");
    }
    score = cache_get_field_content_int(0, "Score");
    SetPlayerScore(playerid, score);
    GivePlayerCash(playerid, pData[playerid][Money]);

    SendClientMessage(playerid,red,"------------------------------------------------------");
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(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,"------------------------------------------------------");
    CheckVipTime(playerid);
    Logged[playerid] = 1;
    return 1;
}
Reply


Messages In This Thread
Whats wrong? - by Face9000 - 27.09.2015, 22:17
Re: Whats wrong? - by ZBits - 28.09.2015, 03:57
Re: Whats wrong? - by Face9000 - 28.09.2015, 10:40
Re: Whats wrong? - by rappy93 - 28.09.2015, 10:59
Re: Whats wrong? - by Face9000 - 28.09.2015, 11:13

Forum Jump:


Users browsing this thread: 2 Guest(s)