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

UserFlags Restrict access


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Contf
Junior Member
Join Date: Jun 2013
Old 06-28-2013 , 13:35   UserFlags Restrict access
Reply With Quote #1

Hi guys.
During the last days I tried to solve the problem by looking in the forum about how to restrict access to a menu if the player does not have the necessary flags, however I could not.

warning 217: loose identation

Code:
new vipflag[ACCESSFLAG_MAX_LENGTH] = "m"
new adminflag[ACCESSFLAG_MAX_LENGTH] = "a"
Code:
public duel_menu(id)
{	
         new userflags = get_user_flags(id)
	if (userflags & (read_flags(adminflag) | read_flags(adminflag)))
	{ 
	if(is_user_alive(id))
	{                  
	static opcion[64]
	
	formatex(opcion, charsmax(opcion),"\y%L", LANG_PLAYER, "VIPMENU")
	new iMenu = menu_create(opcion, "menu")
	
	formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "VIP_LOJA")
	menu_additem(iMenu, opcion, "1")	
	
	formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "VIP_FACA")
	menu_additem(iMenu, opcion, "2")
	
	formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "mpacks")
	menu_additem(iMenu, opcion, "3")
		
	menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, iMenu, 0)
										
	return PLUGIN_HANDLED
	}
	else
			{
				ChatColor(id, "%L", LANG_PLAYER, "DEAD")
			}
	}
         	 
	else if (userflags & (read_flags(vipflag) | read_flags(vipflag)))
	{ 
	if(is_user_alive(id))
	{ 
	if (cs_get_user_team(id) == CS_TEAM_T )
	{ 	
	static opcion[64]
	
	formatex(opcion, charsmax(opcion),"\y%L", LANG_PLAYER, "VipMenu")
	new iMenu = menu_create(opcion, "menu")
	
	formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "VIP_LOJA")
	menu_additem(iMenu, opcion, "1")	
	
	formatex(opcion, charsmax(opcion),"\w%L", LANG_PLAYER, "VIP_FACA")
	menu_additem(iMenu, opcion, "2")
			
	menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
	menu_display(id, iMenu, 0)
			     
	return PLUGIN_HANDLED
	}
         else
				{
					ChatColor(id, "%L", LANG_PLAYER, "ONLYVIP")
				}
	}
	else
			{
				ChatColor(id, "%L", LANG_PLAYER, "DEAD")
			}
	}
	return PLUGIN_HANDLED
}
I appreciate if someone help.
Attached Files
File Type: sma Get Plugin or Get Source (shopvip.sma - 597 views - 35.6 KB)

Last edited by Contf; 06-28-2013 at 13:39. Reason: forget to add some code
Contf is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-28-2013 , 14:01   Re: UserFlags Restrict access
Reply With Quote #2

So, does it work? The warning that you posted can be ignored.
__________________
fysiks is offline
Contf
Junior Member
Join Date: Jun 2013
Old 06-28-2013 , 14:14   Re: UserFlags Restrict access
Reply With Quote #3

Yes it work. Hum ok thanks.
Contf is offline
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 06-28-2013 , 14:51   Re: UserFlags Restrict access
Reply With Quote #4

That is a warning due to code indentation and not a problem.
Clauu 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 20:35.


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