Changed folder name.
Changed folder name.
This commit is contained in:
31
_module/nss/idcust_prvweapb.nss
Normal file
31
_module/nss/idcust_prvweapb.nss
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "idcust_weap_idex"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPlayer = GetPCSpeaker();
|
||||
int iSlot = GetLocalInt( OBJECT_SELF, "iSlot");
|
||||
object oItem = GetItemInSlot( iSlot, oPlayer);
|
||||
//int iIndex = GetLocalInt( OBJECT_SELF, "iIndex");
|
||||
int iIndex = GetItemAppearance( oItem, ITEM_APPR_TYPE_WEAPON_MODEL, ITEM_APPR_WEAPON_MODEL_MIDDLE);
|
||||
int iItemType = GetBaseItemType( oItem);
|
||||
|
||||
if( GetIsDM( oPlayer))
|
||||
SendMessageToPC( oPlayer, "The index before is: " + IntToString( iIndex));
|
||||
|
||||
iIndex--;
|
||||
iIndex = GetNextWeaponIndex( iIndex, iItemType, ITEM_APPR_WEAPON_MODEL_MIDDLE);
|
||||
|
||||
if( GetIsDM( oPlayer))
|
||||
SendMessageToPC( oPlayer, "The index after is: " + IntToString( iIndex));
|
||||
|
||||
//SetLocalInt( OBJECT_SELF, "iIndex", iIndex);
|
||||
object oNewItem = CopyItemAndModify( oItem, ITEM_APPR_TYPE_WEAPON_MODEL, ITEM_APPR_WEAPON_MODEL_MIDDLE, iIndex, TRUE);
|
||||
|
||||
if( GetIsObjectValid( oNewItem))
|
||||
{
|
||||
AssignCommand( oPlayer, ActionEquipItem( oNewItem, iSlot));
|
||||
DestroyObject( oItem);
|
||||
}
|
||||
else
|
||||
DestroyObject( oNewItem);
|
||||
}
|
Reference in New Issue
Block a user