Ezt valahova a mód végére:
stock SaveWeaponsToFile(playerid)
{
new i, string[128],string2[128], weaponid, ammo;
format(string2,128,\"1234/%s.ini\",pName(playerid)); //1234 helyére azt írod ahol a felhasználókat tárolod
for(i=0; i<13; i++)
{
GetPlayerWeaponData(playerid,i,weaponid,ammo);
format(string,sizeof(string),\"Fegyverkez%d\",i);
dini_IntSet(string2,string,weaponid);
format(string,sizeof(string),\"Ammo%d\",i);
dini_IntSet(string2,string,ammo == 65535 ? 0 : ammo);
}
}
stock LoadWeaponsFromFile(playerid)
{
new i, path[128], string[128], weaponid, ammo;
format(path,128,\"1234/%s.ini\",pName(playerid)); //1234 helyére azt írod ahol a felhasználókat tárolod
ResetPlayerWeapons(playerid);
for (i=0; i<13; i++)
{
format(string,sizeof(string),\"Fegyverkez%d\",i);
weaponid = dini_Int(path,string);
format(string,sizeof(string),\"Ammo%d\",i);
ammo = dini_Int(path,string);
GivePlayerWeapon(playerid,weaponid,ammo);
}
}
public OnPlayerDisconnect(playerid, reason) alá:
SaveWeaponsToFile(playerid);
public OnplayerSpawn(playerid) alá:
LoadWeaponsFromFile(playerid);