Problem with types

Blitz3D Forums/Blitz3D Beginners Area/Problem with types

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You don't need the "For p\prop.properties=Each properties" part:

;Create first player 
p.player=New player 
p\prop.properties=New properties 
p\prop\health=100 
;Create second player 
p.player=New player 
p\prop.properties=New properties 
p\prop\health=60 

 
Print PlayerHealth(2) 
WaitKey() 



 
Type player 
	Field prop.properties 
End Type 

Type properties 
	Field health 
End Type 



 
Function PlayerHealth(player_number) 
	For p.player=Each player 
		count=count+1 

		If count=player_number Then 
			;For p\prop.properties=Each properties 
			Return(p\prop\health) ;return health 
			;Next 	
		EndIf 
		
	Next 
End Function