03.06.2013, 20:19
Hello, I've got some probs with my weapon saving.. actually the ammo is the real problem. It loads perfectly BUT the ammo duplicates. I think I have to do something like TempGun & TempAmmo but I'm not sure.. it would be appreciated if someone helped me out on this.
Quote:
SAVING FUNC. Код:
public SaveAccountInfo(playerid) { new cash = GetPlayerCash(playerid); new skin = GetPlayerSkin(playerid); new level = GetPlayerScore(playerid); new int = GetPlayerInterior(playerid); new vw = GetPlayerVirtualWorld(playerid); new Float:X, Float:Y, Float:Z; new Float:facingangle; new Float:health, Float:armour; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); GetPlayerFacingAngle(playerid, facingangle); GetPlayerPos(playerid, X, Y, Z); for (new i = 0; i < 13; i++) { GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); } new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"Player Data"); INI_WriteInt(File,"Cash",cash); INI_WriteInt(File,"Skin",skin); INI_WriteInt(File,"Level",level); INI_WriteInt(File,"Int",int); INI_WriteInt(File,"VW",vw); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]); INI_WriteFloat(File, "FacingAngle", facingangle); INI_WriteFloat(File, "Health", health); INI_WriteFloat(File, "Armour", armour); INI_WriteFloat(File, "LastX", X); INI_WriteFloat(File, "LastY", Y); INI_WriteFloat(File, "LastZ", Z); INI_WriteInt(File,"Weapon0", weapons[0][0]); INI_WriteInt(File,"Weapon1", weapons[1][0]); INI_WriteInt(File,"Weapon2", weapons[2][0]); INI_WriteInt(File,"Weapon3", weapons[3][0]); INI_WriteInt(File,"Weapon4", weapons[4][0]); INI_WriteInt(File,"Weapon5", weapons[5][0]); INI_WriteInt(File,"Weapon6", weapons[6][0]); INI_WriteInt(File,"Weapon7", weapons[7][0]); INI_WriteInt(File,"Weapon8", weapons[8][0]); INI_WriteInt(File,"Weapon9", weapons[9][0]); INI_WriteInt(File,"Weapon10", weapons[10][0]); INI_WriteInt(File,"Weapon11", weapons[11][0]); INI_WriteInt(File,"Weapon12", weapons[12][0]); INI_WriteInt(File,"Ammo0", weapons[0][1]); INI_WriteInt(File,"Ammo1", weapons[1][1]); INI_WriteInt(File,"Ammo2", weapons[2][1]); INI_WriteInt(File,"Ammo3", weapons[3][1]); INI_WriteInt(File,"Ammo4", weapons[4][1]); INI_WriteInt(File,"Ammo5", weapons[5][1]); INI_WriteInt(File,"Ammo6", weapons[6][1]); INI_WriteInt(File,"Ammo7", weapons[7][1]); INI_WriteInt(File,"Ammo8", weapons[8][1]); INI_WriteInt(File,"Ammo9", weapons[9][1]); INI_WriteInt(File,"Ammo10", weapons[10][1]); INI_WriteInt(File,"Ammo11", weapons[11][1]); INI_WriteInt(File,"Ammo12", weapons[12][1]); INI_Close(File); return 1; } Код:
public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Cash",PlayerInfo[playerid][pCash]); INI_Int("Skin",PlayerInfo[playerid][pSkin]); INI_Int("Level",PlayerInfo[playerid][pLevel]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Kills",PlayerInfo[playerid][pKills]); INI_Int("Deaths",PlayerInfo[playerid][pDeaths]); INI_Int("Banned",PlayerInfo[playerid][pBanned]); INI_Float("FacingAngle",PlayerInfo[playerid][pFacingAngle]); INI_Float("Health",PlayerInfo[playerid][pHealth]); INI_Float("Armour",PlayerInfo[playerid][pArmour]); INI_Float("LastX", PlayerInfo[playerid][pLastX]); INI_Float("LastY", PlayerInfo[playerid][pLastY]); INI_Float("LastZ", PlayerInfo[playerid][pLastZ]); INI_Int("Weapon0", weapons[0][0]); INI_Int("Weapon1", weapons[1][0]); INI_Int("Weapon2", weapons[2][0]); INI_Int("Weapon3", weapons[3][0]); INI_Int("Weapon4", weapons[4][0]); INI_Int("Weapon5", weapons[5][0]); INI_Int("Weapon6", weapons[6][0]); INI_Int("Weapon7", weapons[7][0]); INI_Int("Weapon8", weapons[8][0]); INI_Int("Weapon9", weapons[9][0]); INI_Int("Weapon10", weapons[10][0]); INI_Int("Weapon11", weapons[11][0]); INI_Int("Weapon12", weapons[12][0]); INI_Int("Ammo0", weapons[0][1]); INI_Int("Ammo1", weapons[1][1]); INI_Int("Ammo2", weapons[2][1]); INI_Int("Ammo3", weapons[3][1]); INI_Int("Ammo4", weapons[4][1]); INI_Int("Ammo5", weapons[5][1]); INI_Int("Ammo6", weapons[6][1]); INI_Int("Ammo7", weapons[7][1]); INI_Int("Ammo8", weapons[8][1]); INI_Int("Ammo9", weapons[9][1]); INI_Int("Ammo10", weapons[10][1]); INI_Int("Ammo11", weapons[11][1]); INI_Int("Ammo12", weapons[12][1]); return 1; } |