SVN Builds
#11
Here's an example in cChicken.cpp


Code:
if( (rand() % 5) == 0 ) { cPickup* Pickup = new cPickup( (int)(m_Pos->x*32), (int)(m_Pos->y*32), (int)(m_Pos->z*32), cItem( E_ITEM_EGG, 1 ) ); Pickup->Initialize( GetWorld() ); } if( (rand() % 1) == 0 ) { cPickup* Pickup = new cPickup( (int)(m_Pos->x*32), (int)(m_Pos->y*32), (int)(m_Pos->z*32), cItem( E_ITEM_FEATHER, 1 ) ); Pickup->Initialize( GetWorld() ); }


20% chance to drop an egg and 100% chance to drop a feather. Both can happen at the same time. After you run Pickup->Initialize( GetWorld() ); you can create the object again.
Reply
Thanks given by:


Messages In This Thread



Users browsing this thread: 2 Guest(s)