30.12.2009, 15:34
how to make guns save?if someone reconnects the gun will save?thanks
public OnPlayerConnect(playerid)
{
new pName[24], filename[36];
GetPlayerName(playerid, pName, 24);
format(filename, sizeof(filename), "%s.ini", pName);
new weaponid = dini_Int(filename, "Weapon");
new ammo = dini_Int(filename, "Ammo");
GivePlayerWeapon(playerid, weaponid, ammo);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pName[24], filename[36];
GetPlayerName(playerid, pName, 24);
format(filename, sizeof(filename), "%s.ini", pName);
dini_IntSet(filename, "Weapon", GetPlayerWeapon(playerid));
dini_IntSet(filename, "Ammo", GetPlayerAmmo(playerid));
return 1;
}