30.09.2011, 15:55
(
Последний раз редактировалось Dokins; 01.10.2011 в 16:30.
)
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.
I also added a function LoadWeapons(); which contains all of that. Still no sucess.
Thats all under dialog_login.
Thanks in advance.
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]);
}
}
}
Thats all under dialog_login.
Thanks in advance.