Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Banaqs on Nov 18, 2014, 07:21 PM

Title: How to add props in array
Post by: Banaqs on Nov 18, 2014, 07:21 PM
How to add props in array like a this Kills <- array ( GetMaxPlayers() , 0 );
I need a good example
Title: Re: How to add props in array
Post by: Thijn on Nov 18, 2014, 08:43 PM
Props?

Do you mean something like this:
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.