01.01.2013, 14:15
(
Последний раз редактировалось ThePrograme; 02.01.2013 в 14:11.
)
Ok I want to convert this to Y_INI can anyone help me please. THANKS IN ADVANCE - Give +Rep If You Help me!!!
pawn Код:
SaveWeaponsToFile(playerid)
{
new i, path[50], string[128], weaponid, ammo;
path = GetPlayerFormattedName(playerid);
if (!dini_Exists(path)) dini_Create(path);
for (i=0; i<13; i++)
{
GetPlayerWeaponData(playerid,i,weaponid,ammo);
format(string,sizeof(string),"Weapon - %d",i);
dini_IntSet(path,string,weaponid);
format(string,sizeof(string),"AmmoID - %d",i);
dini_IntSet(path,string,ammo == 65535 ? 0 : ammo);
}
}
forward LoadWeaponsToFile(playerid);
public LoadWeaponsToFile(playerid)
{
new i, path[50], string[128], weaponid, ammo;
path = GetPlayerFormattedName(playerid);
ResetPlayerWeapons(playerid);
for (i=0; i<13; i++)
{
format(string,sizeof(string),"Weapon - %d",i);
weaponid = dini_Int(path,string);
format(string,sizeof(string),"AmmoID - %d",i);
ammo = dini_Int(path,string);
GivePlayerWeapon(playerid,weaponid,ammo);
}
AlreadyGiveWeapons[playerid] = true;
}