02.12.2011, 05:34
Hello, I am using a registering system using Y_INI from a tutorial. I want it to save weapons, so I found some codes that might help me. But they are using DUDB. Can you help me converting them to Y_INI?
AND
THIS IS THE TUTORIAL I USED
Thank you!
P.S: I tried to, but failed .
pawn Код:
stock SaveWeapons(playerid)
{
new wepinfo[13][2], strWep[10], strAmmo[50], strSend[128];
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, wepinfo[i][0], wepinfo[i][1]);
format(strWep, 10, "Wep%d", i);
format(strAmmo, 50, "Ammo%d", i);
udb_UserSetInt(ReturnAccount(playerid), strWep, wepinfo[i][0]);
udb_UserSetInt(ReturnAccount(playerid), strAmmo, wepinfo[i][1]);
format(strSend, 128, ":%s: All weapons and ammo saved.", "SNX");
SendClientMessage(playerid, COLOR_GOLD, strSend);
}
}
pawn Код:
stock LoadWeapons(playerid)
{
new strWep[10], strAmmo[50], strSend[128];
for(new i = 0; i < 13; i++)
{
format(strWep, 10, "Wep%d",i);
format(strAmmo, 50, "Ammo%d",i);
GivePlayerWeapon(playerid, udb_UserInt(ReturnAccount(playerid), strWep), udb_UserInt(ReturnAccount(playerid), accounts, strAmmo));
}
format(strSend, 128, ":%s: All weapons and ammo restored.", "SNX");
return SendClientMessage(playerid, COLOR_GOLD, strSend);
}
Thank you!
P.S: I tried to, but failed .