02.01.2011, 02:21
Ok, does this look ok?
Saving:
Edit:
PrimWep_Ammo=198
SubWep_Ammo=100
MeleeWep_Ammo=1
turns into:
PrimWep_Ammo=197
SubWep_Ammo=0
MeleeWep_Ammo=0
I'm guessing it only gets the ammo of the weapon im using?
Edit:
Nvm it sitll only saves prim weapon, even when i use the sub.
Edit:
Oh, I'm dumb.
I had it as:
Instead of:
Код HTML:
GetWeaponAmmo(playerid,weapon) { new weapons[13][2]; for (new i = 0; i < 13; i++) { GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); if(weapons[i][0] == weapon) return weapons[i][1]; } return 0; }
Код HTML:
dini_IntSet(playerfile, "PrimWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"PrimWep"))); dini_IntSet(playerfile, "SubWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"SubWep_Ammo"))); dini_IntSet(playerfile, "MeleeWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"MeleeWep_Ammo")));
PrimWep_Ammo=198
SubWep_Ammo=100
MeleeWep_Ammo=1
turns into:
PrimWep_Ammo=197
SubWep_Ammo=0
MeleeWep_Ammo=0
I'm guessing it only gets the ammo of the weapon im using?
Edit:
Nvm it sitll only saves prim weapon, even when i use the sub.
Edit:
Oh, I'm dumb.
I had it as:
Код HTML:
dini_IntSet(playerfile, "PrimWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"PrimWep"))); dini_IntSet(playerfile, "SubWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"SubWep_Ammo"))); dini_IntSet(playerfile, "MeleeWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"MeleeWep_Ammo")));
Код HTML:
dini_IntSet(playerfile, "PrimWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"PrimWep"))); dini_IntSet(playerfile, "SubWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"SubWep"))); dini_IntSet(playerfile, "MeleeWep_Ammo", GetWeaponAmmo(playerid,GetPVarInt(playerid,"MeleeWep")));