Problematic tiny 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: Problematic tiny loop (
/showthread.php?tid=416258)
Problematic tiny loop -
Ben7544 - 16.02.2013
Hey guys! I've been trying to make a short loop of arrays value so I could just put the string in a function instead of making about three hundred useless lines, could anyone help me out? That's the thing:
Код:
public OnGameModeInit()
{
for (new count=300, skin[300]; count!=0; count--) {
skin[299--] = count; }
// Don't use these lines if it's a filterscript
SetGameModeText("0.001");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
The error that I get every time I try to compile:
PHP код:
error 022: must be lvalue (non-constant)
Thanks in advance!
Re: Problematic tiny loop -
Jefff - 16.02.2013
pawn Код:
new Skin[300];
new Skins;
public OnGameModeInit()
{
for(new skinid; skinid != sizeof(Skin); skinid++)
{
if(skinid != 74)
Skin[Skins++] = skinid;
}
// Don't use these lines if it's a filterscript
SetGameModeText("0.001");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}