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

Else problem read_flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CsIosefin
Senior Member
Join Date: Aug 2009
Old 08-26-2010 , 20:14   Else problem read_flags
Reply With Quote #1

Why not work? I mean if you are not admin, to type normally ... why?
I have not really with ELSE ... and I so want an explanation.
Code:
    for (new i = 0; i < 8; i++)
    {
        if (get_user_flags(id) == read_flags(Flags[i]))
        {
            if(is_user_alive(id) || !is_user_alive(id))
            {
                chat(0, "!y[ %s ] !team*%s* !g%s !y: !team%s", Name[i], (is_user_alive(id) ? "ALIVE" : "DEAD"), name, mes);
            }
        }

            else

            if(is_user_alive(id) || !is_user_alive(id))
            {
                chat(0, "!team*%s* !g%s !y: !team%s", (is_user_alive(id) ? "ALIVE" : "DEAD"), name, mes);
            }
        }
    }
CsIosefin is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-26-2010 , 20:19   Re: Else problem read_flags
Reply With Quote #2

Quote:
Originally Posted by CsIosefin View Post
Code:
  if (get_user_flags(id) & ADMIN_LEVEL_A) //Change to w/e
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-26-2010 , 20:21   Re: Else problem read_flags
Reply With Quote #3

Quote:
Originally Posted by CsIosefin View Post
Why not work? I mean if you are not admin, to type normally ... why?
I have not really with ELSE ... and I so want an explanation.
Code:
    for (new i = 0; i < 8; i++)
    {
        if (get_user_flags(id) == read_flags(Flags[i]))
        {
            if(is_user_alive(id) || !is_user_alive(id))
            {
                chat(0, "!y[ %s ] !team*%s* !g%s !y: !team%s", Name[i], (is_user_alive(id) ? "ALIVE" : "DEAD"), name, mes);
            }
        }

            else

            if(is_user_alive(id) || !is_user_alive(id))
            {
                chat(0, "!team*%s* !g%s !y: !team%s", (is_user_alive(id) ? "ALIVE" : "DEAD"), name, mes);
            }
        }
    }


You will need to show your whole code to get the best help. The issue is probably with "get_user_flags(id) == read_flags(Flags[i])".

Also, what was your intention here:

PHP Code:
if(is_user_alive(id) || !is_user_alive(id)) 
It's [almost] useless as it is there.

So, explain exactly what you want this whole code snippet to do because I'm 100 percent sure that if I "fix" your code it won't work as you expect it to work.
__________________
fysiks 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 17:38.


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