Aller au contenu

Photo

Script help...


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
NakCrAzD

NakCrAzD
  • Members
  • 1 messages
I'm having some issues with this script.. The LOAD event works but none of the rest do..

#include "utility_h"
#include "events_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);

    switch(nEventType)
    {
        case EVENT_TYPE_MODULE_LOAD:
        {
            UT_AddItemToInventory(R"test_staff.uti", 1);
        }
        case EVENT_TYPE_INVENTORY_ADDED:
        {
            object oItem = GetEventObject(ev, 0); // item added
            UT_AddItemToInventory(R"test_staff.uti", 66); // This is to test if the event is being called
            AddItemProperty(oItem, 1000, 100);

            break;
        }
        case EVENT_TYPE_INVENTORY_REMOVED:
        {
            object oItem = GetEventObject(ev, 0); // item added
            UT_AddItemToInventory(R"test_staff.uti", 77);  // This is to test if the event is being called
            AddItemProperty(oItem, 1000, 100);

            break;
        }
        case EVENT_TYPE_EQUIP:
        {
            object oItem = GetEventCreator(ev); // the item being equipped
            UT_AddItemToInventory(R"test_staff.uti", 99);  // This is to test if the event is being called
            AddItemProperty(oItem, 1000, 100);

            break;
        }
        case EVENT_TYPE_UNEQUIP:
        {
            object oItem = GetEventCreator(ev); // the item being unequipped
            UT_AddItemToInventory(R"test_staff.uti", 88);  // This is to test if the event is being called
            AddItemProperty(oItem, 1000, 100);

            break;
        }

    }
}


Modifié par NakCrAzD, 20 novembre 2009 - 09:20 .


#2
AND04

AND04
  • Members
  • 154 messages
the other events don't fire into the Module itself - if you want to override them follow the Link in my signature on how to do that.