06.04.2014, 09:08
(
Последний раз редактировалось Dokins; 06.04.2014 в 15:09.
)
First off, I use my own system of saving and loading my weapons, I save them like you would save vehicles etc.
PlayerWeapons[playerid][w] is the ID of the weapon in the database, not the actual weaponid like Desert Eagle or anything, but the row id.
WepAmmo Is the same thing, it should get the ammo from the ID in the PlayerWeapons, but it won't and I can't figure it out.
Here is where I load the weapons.
Here is where the player SHOULD get them, but it won't set the ammo correctly.
it gets the ID correctly, but not the weapon ammo from WepAmmo.
pawn Код:
for(new w = 0; w < 13; w++)
{
format(fieldname, sizeof(fieldname), "Weapon%d", w);
MySQL_SetInteger(PlayerSQLID[playerid], fieldname, PlayerWeapons[playerid][w], "accounts");
ammo = WepAmmo[PlayerWeapons[playerid][w]];
MySQL_SetInteger(PlayerWeapons[playerid][w], "WepAmmo", ammo, "weapons");
}
WepAmmo Is the same thing, it should get the ammo from the ID in the PlayerWeapons, but it won't and I can't figure it out.
Here is where I load the weapons.
pawn Код:
mysql_get_field( "WepAmmo", QueryString);
WepAmmo[x] = strval( QueryString);
pawn Код:
for(new w = 0; w < 13; w++)
{
new ammo = WepAmmo[PlayerWeapons[playerid][w]];
printf("Ammo: %d", ammo);
new weapon = WepModel[PlayerWeapons[playerid][w]];
printf("WepModel :%d", WepModel[PlayerWeapons[playerid][w]]);
GivePlayerWeapon(playerid,weapon,ammo);
}