changed player index from int to playerid