|
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
|
05-26-2017
, 13:44
Re: [Source 2009 Games] TOGs Chat Tags
|
#50
|
Quote:
Originally Posted by FeelsGoodMan
Not sure what I'm doing wrong here but this plug-in only seems to work for admins regardless of my cfg?
All fields in !settings are greyed out / unselectable and typing !settag [Yourtaghere] gives an "no access" chat response unless you're admin.
Here is my cfg and plug-ins list:
(no error logs)
|
The public version of this never supported a blank/public flag, or "none" flag or sets of flag combos. Replace the HasFlags function (lines 445-472) with this:
Spoiler
PHP Code:
bool:HasFlags(String:sFlags[], client) { if(StrEqual(sFlags, "public", false) || StrEqual(sFlags, "", false)) { return true; } if(StrEqual(sFlags, "none", false)) { return false; } new AdminId:id = GetUserAdmin(client); if(id == INVALID_ADMIN_ID) { return false; } if(CheckCommandAccess(client, "sm_not_a_command", ADMFLAG_ROOT, true)) { return true; } new iCount, iFound, flags; if(StrContains(sFlags, ";", false) != -1) //check if multiple strings { new c = 0, iStrCount = 0; while(sFlags[c] != '\0') { if(sFlags[c++] == ';') { iStrCount++; } } iStrCount++; //add one more for IP after last comma decl String:sTempArray[iStrCount][30]; ExplodeString(sFlags, ";", sTempArray, iStrCount, 30); for(new i = 0; i < iStrCount; i++) { flags = ReadFlagString(sTempArray[i]); iCount = 0; iFound = 0; for(new j = 0; j <= 20; j++) { if(flags & (1<<j)) { iCount++;
if(GetAdminFlag(id, AdminFlag:j)) { iFound++; } } } if(iCount == iFound) { return true; } } } else { flags = ReadFlagString(sFlags); iCount = 0; iFound = 0; for(new i = 0; i <= 20; i++) { if(flags & (1<<i)) { iCount++;
if(GetAdminFlag(id, AdminFlag:i)) { iFound++; } } }
if(iCount == iFound) { return true; } } return false; }
I've attached a revised version for you. Here is how the flags work with the above replacement:
__________________
Last edited by ThatOneGuy; 05-26-2017 at 13:45.
|
|
|
|