[Q] Array Problem Involving random skins
#1

Code:
new Police[7][1] =
{
  {265},
  {266},
  {267},
  {141},
  {150},
  {280},
  {281}
};
Thats at the top of the script.

This is under /duty

Code:
new rand;
rand = random(sizeof(Police));
for(new i = 0; i <= sizeof(Police)-1; i++) {
SetPlayerSkin(playerid, Police[i][rand]);
}
It will say Unknown Command until the SFPD skin then it will work, Whats wrong?

- Cheers Winter
Reply
#2

//top of script
pawn Code:
new rand;

new Police[] =
{
  265, 266, 267, 141, 150, 280, 281
};

//duty command
pawn Code:
rand = random(sizeof(Police));
SetPlayerSkin(playerid, Police[rand]);
Reply
#3

How could i've been so stupid...

Thanks
Reply
#4

Arrays can be tricky little things.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)