Raised This Month: $ Target: $400
 0% 

help needed with this, modifying flags of user.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-12-2011 , 15:03   help needed with this, modifying flags of user.
Reply With Quote #1

PHP Code:
if(grantedAccess[player] == 0)
    {
        new 
bm = (containi(oldFlags[id], "u"));
        new 
zFlag = (containi(oldFlags[id], "z"));
        new 
bmFlag read_flags("u");
        
oldFlags[id] = get_user_flags(player);
        if((
containi(oldFlags[id], "u")))
        {
            return 
PLUGIN_HANDLED;
        }
        else if(
containi(oldFlags[id], "z"))
        {
            
remove_user_flags(player,oldFlags[id],0)
            
set_user_flags(playerbmFlag0);
            
client_print(0,print_chat"Admin name: %s Player name: %s"namename2);
            
grantedAccess[player] = 1;
        }
        else if(!
bm && !zFlag)
        {
            
set_user_flags(playerbmFlag0);
            
client_print(0,print_chat"Admin name: %s Player name: %s"namename2);
            
grantedAccess[player] = 1;
        }
        return 
PLUGIN_HANDLED;
    } 
I Can't figure out what im doing wrong here.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-12-2011 , 16:40   Re: help needed with this, modifying flags of user.
Reply With Quote #2

Show where you create oldFlags variable.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-12-2011 , 16:43   Re: help needed with this, modifying flags of user.
Reply With Quote #3

at the top of plugin under includes

everything else works, this is the part that doesnt work

It should take users flags set to oldFlags and if no flag u adds to it,
if user's oldFlags has "z" removes it and gives u.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-12-2011 , 16:43   Re: help needed with this, modifying flags of user.
Reply With Quote #4

Show the line.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-12-2011 , 16:47   Re: help needed with this, modifying flags of user.
Reply With Quote #5

PHP Code:
new grantedAccess[33];
new 
oldFlags[33]; 
PHP Code:
public client_putinserver(id)
{
    new 
arg1[33];
    
read_argv(1arg131);
    new 
player cmd_target(idarg12);
    
grantedAccess[player] = 0;
    
oldFlags[id] = 0;

__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-12-2011 , 19:00   Re: help needed with this, modifying flags of user.
Reply With Quote #6

PHP Code:
containi(oldFlags[id], "u")
containi(oldFlags[id], "z"


PHP Code:
oldFlags[id] & ADMIN_MENU
oldFlags
[id] & ADMIN_USER 
__________________
fysiks is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-12-2011 , 19:06   Re: help needed with this, modifying flags of user.
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
PHP Code:
containi(oldFlags[id], "u")
containi(oldFlags[id], "z"


PHP Code:
oldFlags[id] & ADMIN_MENU
oldFlags
[id] & ADMIN_USER 
without the containi o.o?
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-12-2011 , 19:08   Re: help needed with this, modifying flags of user.
Reply With Quote #8

Quote:
Originally Posted by Battousai-sama View Post
without the containi o.o?
Yes, because it is not a string. It is a sum of bits (an integer).

I.e. The value of oldFlags[id] is not "abcd" it is something like the integer 143.
__________________
fysiks is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 04-12-2011 , 19:12   Re: help needed with this, modifying flags of user.
Reply With Quote #9

oh i see

Edit: works had a small typo, and thanks for help
__________________

Last edited by Battousai-sama; 04-12-2011 at 19:24.
Battousai-sama is offline
Send a message via MSN to Battousai-sama
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 02:09.


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