void StripPlayer( object oPlayer ) {
//the first time the player load in they lose everything in their inventory
//destroy everything they have currently equipped
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_ARMS ) ) );
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_ARROWS, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_BELT, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_BOLTS, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_BOOTS, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_BULLETS, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_CARMOUR, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_CHEST, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_CLOAK, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_CWEAPON_B, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_CWEAPON_L, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_CWEAPON_R, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_HEAD, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_LEFTHAND, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_LEFTRING, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_NECK, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_RIGHTHAND, oPlayer ) ));
AssignCommand( oPlayer, DestroyObject( GetItemInSlot( INVENTORY_SLOT_RIGHTRING, oPlayer ) ));
//temporary object of what is in inventory
object oItem = GetFirstItemInInventory( oPlayer );
//get each item in the inventory
while( oItem != OBJECT_INVALID )
{
//destroy it
DestroyObject( oItem );
//get the next item
oItem = GetNextItemInInventory( oPlayer );
}
//take away their gold too
//TakeGoldFromCreature( GetGold( oPlayer ), oPlayer, TRUE );
}
Modifié par Tiggers.no.tail, 31 juillet 2011 - 09:29 .