Quote:
Originally Posted by Unkolix
Maybe do it like this?
PHP Code:
public client_authorized(id)
{
/* Register Rank Access */
rank1 = get_user_flags(id) & ADMIN_LEVEL_B;
rank2 = get_user_flags(id) & ADMIN_LEVEL_C;
rank3 = get_user_flags(id) & ADMIN_LEVEL_D;
rank4 = get_user_flags(id) & ADMIN_ALL;
/************************/
if(rank4) //Checks if user has all flags (doesn't need to check if he has others because it is included already)
{
RankName[id] = OWNER; //Sets it as a owner
g_Protected[id] = 1; //Sets protection
}
else if(rank2 && rank3 && !rank1) //Checks if user has LEVEL C, D, but not B
{
RankName[id] = HADMIN; //Sets it as a headadmin
g_Protected[id] = 1; //Sets protection
}
else if(rank3 && !rank2 && !rank1) //Checks if user has LEVEL D, but not B or C
{
RankName[id] = ADMIN; //Sets it as a admin
}
else if(!rank4 && !rank3 && !rank2 && !rank1) //Checks if user hasn't got any levels
{
RankName[id] = PLAYER; //Sets it as a player
}
}
|
i'll test this out tomorrow to late now
thanks...
got any ideas on this one tho?
PHP Code:
public onlineadmins(id) {
new players[32],pnum, player;
get_players(players,pnum);
get_pcvar_string(TAG, PREFIX, charsmax(PREFIX));
new temp[501],name[32], count
for( new i; i<pnum; i++ ) {
if(!g_HideRank[players[i]]) {
player = players[i]
count++
get_user_name(player,name,31)
formatex(temp,500,"%s %s !n(!g%s!n),!t ", temp, name, AccessType[RankName[player]])
}
}
if(count)
client_printc(id, "!g[%s]!n Admins Online:!t %s!n", PREFIX, temp)
else
client_printc(id, "!g[%s]!n No admins online.", PREFIX)
return PLUGIN_HANDLED;
}
doesnt work properly.