10.02.2013, 12:21
I want to save the weapons given by the GivePlayerWeaponEx stock, not given from admin or anything.
GetPlayerWeaponData gets all the weapons data, even if they're from admin or from anywhere. Is there any possibility to check the ammo without using this?
I have this saving code:
GetPlayerWeaponData gets all the weapons data, even if they're from admin or from anywhere. Is there any possibility to check the ammo without using this?
I have this saving code:
pawn Код:
stock saveWeapons(playerid)
{
new szString[350] = "UPDATE weapons SET ", szStr[64], iWeapons[13][2];
for(new i = 0; i < 13; i++) {
GetPlayerWeaponData(playerid, i, weaponVariables[playerid][weaponID][i], weaponVariables[playerid][weaponAmmo][i]);
if(i != 0) format(szStr, sizeof szStr, ",Weapon%d=%d,Ammo%d=%d", i+1, weaponVariables[playerid][weaponID][i], i+1, weaponVariables[playerid][weaponAmmo][i]);
else format(szStr, sizeof szStr, "Weapon%d=%d,Ammo%d=%d", i+1, weaponVariables[playerid][weaponID][i], i+1, weaponVariables[playerid][weaponAmmo][i]);
strins(szString, szStr, strlen(szString));
}
strins(szString, sprintf(" WHERE Name='%s'", GetName(playerid)), strlen(szString));
return mysql_query(szString);
}