MySQL Loading Weapons, Not working....
#1

It saves the weapons to the database under the user account, but wont load them, I can't figure why.

Where would be a good place to add this code, also, I've tried OnPlayerSpawn and under DIALOG_LOGIN.

pawn Код:
for(new p = 0; p < MAX_PLAYERS; p++)
                    {
                    if(LoggedIn[p] == 1 && IsPlayerConnected(p))
                        {
                            for(new w = 0; w < 13; w++)
                            {
                                new fieldname[50];
                                PlayerSQLID[p] = MySQL_GetValue(p, "id", "Accounts");
                                format(fieldname, sizeof(fieldname), "Weapon%d", w);
                                PlayerWeapons[p][w] = MySQL_GetValue(PlayerSQLID[p], fieldname, "Accounts");
                                format(fieldname, sizeof(fieldname), "Weapon%dAmmo", w);
                                PlayerWeaponAmmo[p][w] = MySQL_GetValue(PlayerSQLID[p], fieldname, "Accounts");
                               
                                if(PlayerWeapons[p][w] > 0) GivePlayerWeapon(p, PlayerWeapons[p][w], PlayerWeaponAmmo[p][w]);
                            }
                        }
                    }
I also added a function LoadWeapons(); which contains all of that. Still no sucess.

Thats all under dialog_login.

Thanks in advance.
Reply


Messages In This Thread
MySQL Loading Weapons, Not working.... - by Dokins - 30.09.2011, 15:55
Re: MySQL Loading Weapons, Not working.... - by Dokins - 01.10.2011, 16:31
Re: MySQL Loading Weapons, Not working.... - by MadeMan - 01.10.2011, 20:50

Forum Jump:


Users browsing this thread: 2 Guest(s)