Saving weapon info
#1

Hi, I'm trying to update my filterscript right now by saving the weapon positions. The problem is that the string I format stays empty.
This is the code:
Код:
SaveWeaponInfo(playerid)
{
	new INI:File = INI_Open(WeaponInfoFile(playerid)), string[68], weapon[2];
	
	for (new i = 22; i <= 38; i++)
	{
		format(string, sizeof(string), "%.5f | %.5f | %.5f | %.5f | %.5f | %.5f | %d | %d", WeaponInfo[playerid][i][Position][0], WeaponInfo[playerid][i][Position][1], WeaponInfo[playerid][i][Position][2], WeaponInfo[playerid][i][Position][3], WeaponInfo[playerid][i][Position][4],  WeaponInfo[playerid][i][Position][5], WeaponInfo[playerid][i][Bone], WeaponInfo[playerid][i][Hidden]);
		valstr(weapon, i);
		INI_WriteString(File, weapon, string);
		printf("%s", string);
		printf("%s", weapon);
	}
	INI_Close(File);
}
This is what it prints:
Код:
[20:36:21] 
[20:36:21] 22
[20:36:21] 
[20:36:21] 23
[20:36:21] 
[20:36:21] 24
[20:36:21] 
[20:36:21] 25
[20:36:21] 
[20:36:21] 26
[20:36:21] 
[20:36:21] 27
[20:36:21] 
[20:36:21] 28
[20:36:21] 
[20:36:21] 29
[20:36:21] 
[20:36:21] 30
[20:36:21] 
[20:36:21] 31
[20:36:21] 
[20:36:21] 32
[20:36:21] 
[20:36:21] 33
[20:36:21] 
[20:36:21] 34
[20:36:21] 
[20:36:21] 35
[20:36:21] 
[20:36:21] 36
[20:36:21] 
[20:36:21] 37
[20:36:21] 
[20:36:21] 38
What am I doing wrong here?
Reply
#2

Try without specifying a decimal amount. I think I had a similar issue and this resolved it
Reply
#3

Quote:
Originally Posted by AMouldyLemon
Посмотреть сообщение
Try without specifying a decimal amount. I think I had a similar issue and this resolved it
Eh, what do you mean?
Reply
#4

%f | %f
Reply
#5

Oh, alright thanks. I don't really understand why it would cause any problems, but I'll try it tomorrow anyways.
Reply
#6

Still doesn't work. Anyone?
Reply
#7

I could fix it by creating a function that formats the weapon info...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)