29.08.2011, 09:31
I assume that you mean this
Saving the string:
Then you could just split the line using sccanf. I don't see why you would want to, because it uses more cells and it's way easier to just store single digits.
Saving the string:
pawn Код:
//Top
new WepData[2][50];
//Saving
new weapons[13][2];
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
if(!WepData[0][0])
{
format(WepData[0], 50, "%d", weapons[i][0]);
format(WepData[1], 50, "%d", weapons[i][1]);
}
else if(WepData[0][0] != 0)
{
format(WepData[0], 50, "%d %d", WepData[0], weapons[i][0]);
format(WepData[1], 50, "%d %d", WepData[1], weapons[i][1]);
}
}
//WepData[0] prints the weapon IDS
//WepData[1] prints the ammo.