y_ini loop - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: y_ini loop (
/showthread.php?tid=608559)
y_ini loop -
KesaSport - 02.06.2016
PHP код:
INI_ParseFile(fmat(query, "inventory/%s.ini", pName(playerid)), "load_inventory_%s", .bExtra = true, .extra = playerid);
forward load_inventory_data(playerid, name[], value[]);
public load_inventory_data(playerid, name[], value[])
{
new wepdata[2][12];
for(new i; i < 12; i++)
{
new file[30];
INI_Int(fmat(file, "Weapon%d", i), wepdata[0][i]);
INI_Int(fmat(file, "Ammo%d", i), wepdata[1][i]);
GivePlayerWeapon(playerid, wepdata[0][i], wepdata[1][i]);
printf("Call %d", i);
}
return (true);
}
Printing:
PHP код:
[18:30:21] Call 0
[18:30:21] Call 0
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 8
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 8
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 8
[18:30:21] Call 9
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 8
[18:30:21] Call 9
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 8
[18:30:21] Call 9
[18:30:21] Call 10
[18:30:21] Call 0
[18:30:21] Call 1
[18:30:21] Call 2
[18:30:21] Call 3
[18:30:21] Call 4
[18:30:21] Call 5
[18:30:21] Call 6
[18:30:21] Call 7
[18:30:21] Call 8
[18:30:21] Call 9
[18:30:21] Call 10
Any ideas?
Re: y_ini loop -
Dayrion - 02.06.2016
What is the problem?
I did the same discorvery. xD -
HERE
What i discovered:
Parameter 1
Parameter 2
Parameter 3
YINI does :
new loop.
Load Parameter 1
end loop
new loop.
Load Parameter 1
Load Parameter 2
end loop.
new loop.
Load Parameter 1
Load Parameter 2
Load Parameter 3
end loop.
Re: y_ini loop -
KesaSport - 02.06.2016
PHP код:
for(new i; i < sizeof Inventory; i++)
{
new file[30];
INI_Int(fmat(file, "Item%d", i), pVar[playerid][inv_itemid][i]);
INI_Int(fmat(file, "Ammount%d", i), pVar[playerid][inv_itemammount][i]);
}
for(new i; i < 6; i++)
{
new file[30];
INI_Int(fmat(file, "ItemInSlot%d", i), pVar[playerid][inv_ItemInSlot][i]);
defer AttachPlayerObjects(playerid);
}
new wepdata[2][12];
for(new i; i < 12; i++)
{
new file[30];
INI_Int(fmat(file, "Weapon%d", i), wepdata[0][i]);
INI_Int(fmat(file, "Ammo%d", i), wepdata[1][i]);
GivePlayerWeapon(playerid, wepdata[0][i], wepdata[1][i]);
printf("Call %d", i);
}
First 2 loops working fine..