avertuss 48 Posted July 26, 2018 Share Posted July 26, 2018 Hi. How can i make that players need to wait 3s after equip costume etc? Player equiped item -> want to equip other or unequip after 1s -> nope, you must wait 3seconds. Idk how can i explain it better. I hope you understand. Link to comment Share on other sites More sharing options...
ridetpro 116 Posted July 26, 2018 Share Posted July 26, 2018 // CHAR.H public: DWORD GetLastEquipCostumeTime() const { return m_dwLastEquipCostumeTime; } private: DWORD m_dwLastEquipCostumeTime; }; CHAR.CPP // m_dwKillerPID = 0; // m_iMoveCount = 0; m_dwLastEquipCostumeTime = 0; //CHAR_ITEM.CPP case ITEM_COSTUME: { int CalcLastEquipSec = (get_dword_time() - ch->GetLastEquipCostumeTime()) / 3000; if (CalcLastMoveSec < 3) // Replace 3 with seconds number. { ChatPacket(CHAT_TYPE_INFO, "Wait three seconds"); return false; } if (!item->IsEquipped()) { EquipItem(item); } else { UnequipItem(item); } } break; 2 Link to comment Share on other sites More sharing options...
kasko30 19 Posted July 26, 2018 Share Posted July 26, 2018 Or just this simple code: find in char_item.cpp : case ITEM_PICK: // END_OF_MINING if (!item->IsEquipped()) EquipItem(item); else UnequipItem(item); break; replace with: case ITEM_PICK: if (!item->IsEquipped()) { if (GetQuestFlag("ARMOR.CHECKER") && get_global_time() < GetQuestFlag("ARMOR.CHECKER")) { ChatPacket(CHAT_TYPE_INFO, " you need to wait %d sec.", (GetQuestFlag("ARMOR.CHECKER") - get_global_time()) % 60); return false; } EquipItem(item); SetQuestFlag("ARMOR.CHECKER", get_global_time() + 3); } else UnequipItem(item); break; 1 Link to comment Share on other sites More sharing options...
ridetpro 116 Posted July 26, 2018 Share Posted July 26, 2018 Acum 11 minute, kasko30 a spus: Or just this simple code: find in char_item.cpp : case ITEM_PICK: // END_OF_MINING if (!item->IsEquipped()) EquipItem(item); else UnequipItem(item); break; replace with: case ITEM_PICK: if (!item->IsEquipped()) { if (GetQuestFlag("ARMOR.CHECKER") && get_global_time() < GetQuestFlag("ARMOR.CHECKER")) { ChatPacket(CHAT_TYPE_INFO, " you need to wait %d sec.", (GetQuestFlag("ARMOR.CHECKER") - get_global_time()) % 60); return false; } EquipItem(item); SetQuestFlag("ARMOR.CHECKER", get_global_time() + 3); } else UnequipItem(item); break; I do not like working with QuestFlags where it is not necessary. Link to comment Share on other sites More sharing options...
kasko30 19 Posted July 26, 2018 Share Posted July 26, 2018 1 hour ago, ridetpro said: I do not like working with QuestFlags where it is not necessary. Dude there is no quest flags with this code ???! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now