Hello!
By implementing the Ban Tool from VegaS, I found that it is the function that checks whether or not you are a member of the staff.
Original code:
- bool CheckIsStaffAdmin(LPCHARACTER ch)
- {
- const char* arListMembers[9] = /* Here add people member from staff what you want to have acces on administration area ban, unlimited slots !*/
- {
- "[SA]Tibetan",
- "[SA]Ayana",
- "[GF]Twigo",
- "[GM]NaNo"
- };
- for(unsigned int key = 0; key < _countof(arListMembers); key++) {
- return ((!strcmp(arListMembers[key], ch->GetName())) && ch->GetGMLevel() > GM_PLAYER) ? true : false;
- }
- }
Alles anzeigen
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Okay, but what's the problem?
The problem is logical, namely, the function checks whether the first member of the list is a member of staff or not, and returns true or false, ignoring the rest because of the premature return entry.
How do we solve it?
We replace the contents above:
- bool CheckIsStaffAdmin(LPCHARACTER ch)
- {
- const char* arListMembers[] = /* Here add people member from staff what you want to have acces on administration area ban, unlimited slots !*/
- {
- "[SA]Tibetan",
- "[SA]Ayana",
- "[GF]Twigo",
- "[GM]NaNo"
- };
- for(unsigned int key = 0; key < _countof(arListMembers); key++)
- {
- if ((!strcmp(arListMembers[key], ch->GetName())) && ch->GetGMLevel() > GM_PLAYER)
- return true;
- }
-
- return false;
- }
Alles anzeigen
Bitte melden Sie sich an, um diesen Anhang zu sehen.