21.09.2011, 21:10
I know I post a lot, but I need help with this:
yes, I did code this, but cannot figure out why it wont work. It won\'t give the player weapon when they login and it doesn\'t appear to save either, here is the saving:
Just wont load or save, yes it connect\'s to database.
pawn Code:
if(strcmp(password, inputtext, false) == 0)
{
LoggedIn[playerid] = true;
for(new w = 0; w < 13; w++)
{
new fieldname[50];
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "Accounts");
format(fieldname, sizeof(fieldname), "Weapon%d", w);
PlayerWeapons[playerid][w] = MySQL_GetValue(PlayerSQLID[playerid], fieldname, "Accounts");
format(fieldname, sizeof(fieldname), "Weapon%dAmmo", w);
PlayerWeaponAmmo[playerid][w] = MySQL_GetValue(PlayerSQLID[playerid], fieldname, "Accounts");
if(PlayerWeapons[playerid][w] > 0) GivePlayerWeapon(playerid, PlayerWeapons[playerid][w], PlayerWeaponAmmo[playerid][w]);
}
yes, I did code this, but cannot figure out why it wont work. It won\'t give the player weapon when they login and it doesn\'t appear to save either, here is the saving:
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
for(new w = 0; w < 13; w++)
{
GetPlayerWeaponData(playerid, w, PlayerWeapons[playerid][w], PlayerWeaponAmmo[playerid][w]);
new fieldname[50], Float: armour;
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "Accounts");
format(fieldname, sizeof(fieldname), "Weapon%d", w);
MySQL_SetInteger(PlayerSQLID[playerid], fieldname, PlayerWeapons[playerid][w], "Accounts");
format(fieldname, sizeof(fieldname), "Weapon%dAmmo", w);
MySQL_SetInteger(PlayerSQLID[playerid], fieldname, PlayerWeaponAmmo[playerid][w], "Accounts");
GetPlayerArmour(playerid, armour);
MySQL_SetFloat(PlayerSQLID[playerid], "Armour", armour, "Accounts");
}
return 1;
}
Just wont load or save, yes it connect\'s to database.