Raised This Month: $ Target: $400
 0% 

Solved Give access to menu, Small problem :)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xTr3m3r
Member
Join Date: Feb 2010
Old 02-14-2017 , 01:16   Re: Give access to menu, Small problem :)
Reply With Quote #9

Quote:
Originally Posted by Black Rose View Post
I don't really understand your error. Code does exactly what you tell it to, so the problem that it would print both messages is impossible. Unless you're sending the command twice.

I don't know of anything that would strip the flags unless you have conflicting plugins.

Code:
GiveAccess(id) {     if ( ! ( get_user_flags(id) & ACCESS_ADMIN_LEVEL ) )         return;     new player, body;     get_user_aiming(id, player, body);     if ( ! player || ! is_user_connected(player) )         return;     new szPlayerName[32]     get_user_name(player, szPlayerName, charsmax(szPlayerName));     new tempFlags = get_user_flags(player);     if ( tempFlags & ACCESS_ADMIN_LEVEL) {         client_print(id, print_chat, "%s %s has got access already.", Prefix, szPlayerName);         return;     }     set_user_flags(player, tempFlags & read_flags("u"));     client_print(player, print_chat, "%s You now have access. Enjoy!", Prefix);     client_print(id, print_chat, "%s %s has access now.", Prefix, szPlayerName); }
Just a side note: Keeping the code structure flat enables you to more easily handle different outcomes and understand the code.
Works perfectly. Thanks!

Last edited by xTr3m3r; 02-14-2017 at 01:16.
xTr3m3r is offline
 



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 21:01.


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