Registration Problem [MySQL]
#3

pawn Код:
stock MySQL_Login(playerid)
{
    new query[900], pname[24], savingstring[50];
    GetPlayerName(playerid, pname, 24);
    format(query, sizeof(query), "SELECT Cash, Level, EXP, Rank, TurfsCaptured, TurfsLost, Kills, Deaths, Score, Muted, Warnings, Vip FROM playerdata WHERE User = '%s'", pname);
    mysql_query(query);
    mysql_store_result();
    while(mysql_fetch_row_format(query,"|"))
    {
        mysql_fetch_field_row(savingstring, "Cash"); GivePlayerMoney(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "Level"); PInfo[playerid][Level] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "EXP"); PInfo[playerid][EXP] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Rank"); PInfo[playerid][Rank] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "TurfsCaptured"); PInfo[playerid][TurfsCaptured] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "TurfsLost"); PInfo[playerid][TurfsLost] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Kills"); PInfo[playerid][Kills] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Deaths"); PInfo[playerid][Deaths] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Score"); PInfo[playerid][Score] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Muted"); PInfo[playerid][Muted] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Warnings"); PInfo[playerid][Warnings] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Vip"); PInfo[playerid][Vip] = strval(savingstring);
    }
    mysql_free_result();
    TogglePlayerSpectating(playerid, 0);
    PInfo[playerid][Logged] = 1;
    SendClientMessage(playerid,COLOR_ORANGE,"[*]: You Have Successfully Logged In!");
    return 1;
}
Reply


Messages In This Thread
Registration Problem [MySQL] - by Littlehelper - 26.07.2012, 18:47
Re: Registration Problem [MySQL] - by Misiur - 26.07.2012, 19:09
Re: Registration Problem [MySQL] - by Littlehelper - 26.07.2012, 19:14
Re: Registration Problem [MySQL] - by Dan. - 26.07.2012, 19:15
Re: Registration Problem [MySQL] - by FireCat - 26.07.2012, 19:16
Re: Registration Problem [MySQL] - by Littlehelper - 27.07.2012, 13:09
Re: Registration Problem [MySQL] - by FireCat - 27.07.2012, 13:24

Forum Jump:


Users browsing this thread: 1 Guest(s)