Using an array to save this...
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Do you mean something like this

pawn Код:
stock SavePlayerWeapons(playerid)
{
    if(PlayerStatistics[playerid][pAuth] == 1)
    {
        for(new x = 0; x < 12; x++)
        {
            GetPlayerWeaponData(playerid, x, PlayerStatistics[playerid][pWeapons][x], PlayerStatistics[playerid][pAmmo][x]);

            format(Query, sizeof(Query), "UPDATE `Accounts` SET `Weapons%d` = %d AND `Ammo%d` = %d WHERE `UserID` = %d", PlayerStatistics[playerid][pWeapons][x], x, PlayerStatistics[playerid][pAmmo][x], x, PlayerStatistics[playerid][pDatabaseID]);
            mysql_query(Query);
        }
    }
    return 1;
}
Or you could save it all into a single field and use sscanf to split it.
Could you elaborate a little more on the sscanf part?
Reply


Messages In This Thread
Using an array to save this... - by Scenario - 17.10.2010, 03:21
Re: Using an array to save this... - by [HiC]TheKiller - 17.10.2010, 04:40
Re: Using an array to save this... - by Scenario - 17.10.2010, 15:03

Forum Jump:


Users browsing this thread: 1 Guest(s)