03.05.2013, 21:09
This code is crashing my pawn and I need your help please
What is wrong with my code ?
What is wrong with my code ?
pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "Weapons/%s.ini", name);
if(!fexist(UserWeapon(playerid)))
{
new INI:File = INI_Open(UserWeapon(playerid));
INI_SetTag(File,"Weapons");
INI_WriteInt(file, "Weapon1",WeaponInfo[playerid][Weapon1] = 0);
INI_WriteInt(file, "Weapon1a",WeaponInfo[playerid][Weapon1a] = 0);
INI_WriteInt(file, "Weapon2",WeaponInfo[playerid][Weapon2] = 0);
INI_WriteInt(file, "Weapon2a",WeaponInfo[playerid][Weapon2a] = 0);
INI_WriteInt(file, "Weapon3",WeaponInfo[playerid][Weapon3] = 0);
INI_WriteInt(file, "Weapon3a",WeaponInfo[playerid][Weapon3a] = 0);
INI_WriteInt(file, "Weapon4",WeaponInfo[playerid][Weapon4] = 0);
INI_WriteInt(file, "Weapon4a",WeaponInfo[playerid][Weapon4a] = 0);
INI_WriteInt(file, "Weapon5",WeaponInfo[playerid][Weapon5] = 0);
INI_WriteInt(file, "Weapon5a",WeaponInfo[playerid][Weapon5a] = 0);
INI_WriteInt(file, "Weapon6",WeaponInfo[playerid][Weapon6] = 0);
INI_WriteInt(file, "Weapon6a",WeaponInfo[playerid][Weapon6a] = 0);
INI_WriteInt(file, "Weapon7",WeaponInfo[playerid][Weapon7] = 0);
INI_WriteInt(file, "Weapon7a",WeaponInfo[playerid][Weapon7a] = 0);
INI_WriteInt(file, "Weapon8",WeaponInfo[playerid][Weapon8] = 0);
INI_WriteInt(file, "Weapon8a",WeaponInfo[playerid][Weapon8a] = 0);
INI_WriteInt(file, "Weapon9",WeaponInfo[playerid][Weapon9] = 0);
INI_WriteInt(file, "Weapon9a",WeaponInfo[playerid][Weapon9a] = 0);
INI_WriteInt(file, "Weapon10",WeaponInfo[playerid][Weapon10] = 0);
INI_WriteInt(file, "Weapon10a",WeaponInfo[playerid][Weapon10a] = 0);
INI_WriteInt(file, "Weapon11",WeaponInfo[playerid][Weapon11] = 0);
INI_WriteInt(file, "Weapon11a",WeaponInfo[playerid][Weapon11a] = 0);
INI_WriteInt(file, "Weapon12",WeaponInfo[playerid][Weapon12] = 0);
INI_WriteInt(file, "Weapon12a",WeaponInfo[playerid][Weapon12a] = 0);
}
else
{
WeaponInfo[playerid][Weapon1] = INI_Int(file, "Weapon1");
WeaponInfo[playerid][Weapon1a] = INI_Int(file, "Weapon1a");
WeaponInfo[playerid][Weapon2] = INI_Int(file, "Weapon2");
WeaponInfo[playerid][Weapon2a] = INI_Int(file, "Weapon2a");
WeaponInfo[playerid][Weapon3] = INI_Int(file, "Weapon3");
WeaponInfo[playerid][Weapon3a] = INI_Int(file, "Weapon3a");
WeaponInfo[playerid][Weapon4] = INI_Int(file, "Weapon4");
WeaponInfo[playerid][Weapon4a] = INI_Int(file, "Weapon4a");
WeaponInfo[playerid][Weapon5] = INI_Int(file, "Weapon5");
WeaponInfo[playerid][Weapon5a] = INI_Int(file, "Weapon5a");
WeaponInfo[playerid][Weapon6] = INI_Int(file, "Weapon6");
WeaponInfo[playerid][Weapon6a] = INI_Int(file, "Weapon6a");
WeaponInfo[playerid][Weapon7] = INI_Int(file, "Weapon7");
WeaponInfo[playerid][Weapon7a] = INI_Int(file, "Weapon7a");
WeaponInfo[playerid][Weapon8] = INI_Int(file, "Weapon8");
WeaponInfo[playerid][Weapon8a] = INI_Int(file, "Weapon8a");
WeaponInfo[playerid][Weapon9] = INI_Int(file, "Weapon9");
WeaponInfo[playerid][Weapon9a] = INI_Int(file, "Weapon9a");
WeaponInfo[playerid][Weapon10] = INI_Int(file, "Weapon10");
WeaponInfo[playerid][Weapon10a] = INI_Int(file, "Weapon10a");
WeaponInfo[playerid][Weapon11] = INI_Int(file, "Weapon11");
WeaponInfo[playerid][Weapon11a] = INI_Int(file, "Weapon11a");
WeaponInfo[playerid][Weapon12] = INI_Int(file, "Weapon12");
WeaponInfo[playerid][Weapon12a] = INI_Int(file, "Weapon12a");
}