How to add props in array

Banaqs

  • Newbie
  • Posts: 25
How to add props in array
« on November 18th, 2014, 07:21 PM »
How to add props in array like a this
Code: [Select]
Kills <- array ( GetMaxPlayers() , 0 );

I need a good example

Thijn

  • VC:MP Beta Tester
  • Posts: 1,689
Re: How to add props in array
« Reply #1, on November 18th, 2014, 08:43 PM »
Props?

Do you mean something like this:
Code: [Select]
class PlayerInfo {
Kills = 0;
Deaths = 0;
}

pInfo <- array( GetMaxPlayers(), null );

function onPlayerJoin( pPlayer ) {
pInfo[ pPlayer.ID ] = PlayerInfo();

print( "Kills: " + pInfo[ pPlayer.ID ].Kills );
}

Untested, but should give an idea.