Raised This Month: $51 Target: $400
 12% 

whats wrong here?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Queqerror
Junior Member
Join Date: Jul 2017
Old 07-17-2017 , 12:02   whats wrong here?
Reply With Quote #1

http://prntscr.com/fwsew0 ? it only takes the admin title and not the supervisor title do you know why ?
Queqerror is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-17-2017 , 12:28   Re: whats wrong here?
Reply With Quote #2

Hi, Because of 'else' accolades.

You told plugin if(GetConVarBool(xxx)) then check for ban flag - else check for change map flag !

So if plugin is enabled, it only sets admin title and if plugin is disabled, it only sets supervisor title !

Now just delete both of accolades before and after else and it will be fine.


EDIT: It was better to paste the code part here instead of screenshot to receive help better and easier.
Also this problem is related to Scripting forum and it was better to post it there.

Last edited by WatchDogs; 07-17-2017 at 12:32.
WatchDogs is offline
Queqerror
Junior Member
Join Date: Jul 2017
Old 07-17-2017 , 13:08   Re: whats wrong here?
Reply With Quote #3

sorry im new really sorry
Queqerror is offline
WatchDogs
Senior Member
Join Date: Oct 2015
Location: Iran
Old 07-17-2017 , 16:03   Re: whats wrong here?
Reply With Quote #4

No problem, I just said for your knowledge.


Good Luck ;)
WatchDogs is offline
Queqerror
Junior Member
Join Date: Jul 2017
Old 07-18-2017 , 09:20   Re: whats wrong here?
Reply With Quote #5

// Admin Clantag
if (GetConVarBool(g_hAdminClantag))
{
if (GetUserFlagBits(client) & ADMFLAG_CHEATS)
{
Format(g_pr_chat_coloredrank[client], 128, "%s %cSUPERVISOR%c", g_pr_chat_coloredrank[client], DARKBLUE, WHITE);
Format(g_pr_rankname[client], 128, "");
Format(g_pr_rankname[client], 128, "SUPERVISOR");

if (GetUserFlagBits(client) & ADMFLAG_BAN)
{
Format(g_pr_chat_coloredrank[client], 128, "%s %cADMIN%c", g_pr_chat_coloredrank[client], BLUE, WHITE);
Format(g_pr_rankname[client], 128, "");
Format(g_pr_rankname[client], 128, "ADMIN");


}
}
i wanna create 3 ranks ( owner , supervisor, admin ) and i cant lol all the time my admins get supeervisor title or i will have owner
Queqerror is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-18-2017 , 09:48   Re: whats wrong here?
Reply With Quote #6

You should use the code tags by going advanced, it will be easier for us and yourself to read
Code:
if (GetConVarBool(g_hAdminClantag))
{
	if (GetUserFlagBits(client) & ADMFLAG_CHEATS)
	{
		Format(g_pr_chat_coloredrank[client], 128, "%s %cSUPERVISOR%c", g_pr_chat_coloredrank[client], DARKBLUE, WHITE);
		Format(g_pr_rankname[client], 128, "");
		Format(g_pr_rankname[client], 128, "SUPERVISOR");
	}
	if (GetUserFlagBits(client) & ADMFLAG_BAN)
	{
		Format(g_pr_chat_coloredrank[client], 128, "%s %cADMIN%c", g_pr_chat_coloredrank[client], BLUE, WHITE);
		Format(g_pr_rankname[client], 128, "");
		Format(g_pr_rankname[client], 128, "ADMIN");
	}
}
now for your issue you might try this and make sure every ranks you want them doesn't have a flag another has. i can't test i don't have a server atm so it might not work

Code:
if (GetConVarBool(g_hAdminClantag))
{
	if (GetUserFlagBits(client) & ADMFLAG_ROOT)
	{
		// your owner things
	}
	else
	{
		if (GetUserFlagBits(client) & ADMFLAG_CHEATS)
		{
			Format(g_pr_chat_coloredrank[client], 128, "%s %cSUPERVISOR%c", g_pr_chat_coloredrank[client], DARKBLUE, WHITE);
			Format(g_pr_rankname[client], 128, "");
			Format(g_pr_rankname[client], 128, "SUPERVISOR");
		}
		else
		{
			if (GetUserFlagBits(client) & ADMFLAG_BAN)
			{
			Format(g_pr_chat_coloredrank[client], 128, "%s %cADMIN%c", g_pr_chat_coloredrank[client], BLUE, WHITE);
			Format(g_pr_rankname[client], 128, "");
			Format(g_pr_rankname[client], 128, "ADMIN");
			}
		}
	}
}

Last edited by blacklagoon; 07-18-2017 at 10:01.
blacklagoon is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode