Array error - 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: Array error (
/showthread.php?tid=536326)
Array error -
Meisternuke - 08.09.2014
Why does this work:
ZiviShown[0] = Zivi[skincounter[playerid]];
ZiviShown[1] = Zivi[skincounter[playerid]+1];
ZiviShown[2] = Zivi[skincounter[playerid]+2];
ZiviShown[3] = Zivi[skincounter[playerid]+3];
and this not:
ZiviShown = {Zivi[skincounter[playerid]],Zivi[skincounter[playerid]+1],Zivi[skincounter[playerid]+2],Zivi[skincounter[playerid]+3]};
Re: Array error -
SickAttack - 09.09.2014
Perform a loop 4 times, and asign it a character.
pawn Код:
for(new i = 0; i < 4; i++) ZiviShown[i] = Zivi[skincounter[playerid] + i];
AW: Array error -
Meisternuke - 09.09.2014
that wouldnt solve anything for me =D
i got other things to set to:
for example:
ZiviShown[0] = Zivi[skincounter[playerid]];
ZiviShown[1] = Zivi[0];
ZiviShown[2] = Zivi[1];
ZiviShown[3] = Zivi[2];
or
ZiviShown[0] = Zivi[ziviSkinCounterMax-1];
ZiviShown[1] = Zivi[0];
ZiviShown[2] = Zivi[1];
ZiviShown[3] = Zivi[2]
many different values
Re: Array error -
SickAttack - 09.09.2014
The ones that are singular do them how you're doing them right now and the ones that are proportional do them like mentioned below.
pawn Код:
ZiviShown[0] = Zivi[skincounter[playerid]];
for(new i = 1; i < 4; i++) ZiviShown[i] = Zivi[i - 1];
ZiviShown[0] = Zivi[ziviSkinCounterMax-1];
for(new i = 1; i < 4; i++) ZiviShown[i] = Zivi[i - 1];
AW: Array error -
Meisternuke - 09.09.2014
ok ty