Array error
#1

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]};
Reply
#2

Perform a loop 4 times, and asign it a character.

pawn Код:
for(new i = 0; i < 4; i++) ZiviShown[i] = Zivi[skincounter[playerid] + i];
Reply
#3

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
Reply
#4

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];
Reply
#5

ok ty
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)