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

[Help] get_user_flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 04-06-2015 , 04:36   [Help] get_user_flags
Reply With Quote #1

I wanna send an chat message ONLY to players that have ADMIN_KICK flag.
Cant make it work properly.
This is what i have tried.

Spoiler
Syturi0 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 04-06-2015 , 04:45   Re: [Help] get_user_flags
Reply With Quote #2

I managed to make it work by doing this.

Spoiler


Ty anyways.

Last edited by Syturi0; 04-06-2015 at 04:45.
Syturi0 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 04-06-2015 , 05:18   Re: [Help] get_user_flags
Reply With Quote #3

I don't see any problems with your first code:
Code:
            if(get_user_flags(id) & ADMIN_KICK)
            {
                colorchat(id, "!n[Aviso] !gO jogador !n%s !gescreveu: !n%s", name, message)
                client_cmd(id, "spk aS_outros/alerta_palavrao.wav")
            }
zmd94 is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 04-06-2015 , 08:02   Re: [Help] get_user_flags
Reply With Quote #4

Yes ur right i can't see a problem there ...

but Why did you add a loop?
Freezo Begin is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 04-06-2015 , 14:22   Re: [Help] get_user_flags
Reply With Quote #5

Quote:
Originally Posted by Freezo Begin View Post
Yes ur right i can't see a problem there ...

but Why did you add a loop?
Can you show me the better way please?
Syturi0 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 04-06-2015 , 17:41   Re: [Help] get_user_flags
Reply With Quote #6

Quote:
Originally Posted by zmd94 View Post
I don't see any problems with your first code:
Code:
            if(get_user_flags(id) & ADMIN_KICK)
            {
                colorchat(id, "!n[Aviso] !gO jogador !n%s !gescreveu: !n%s", name, message)
                client_cmd(id, "spk aS_outros/alerta_palavrao.wav")
            }
Quote:
Originally Posted by Freezo Begin View Post
Yes ur right i can't see a problem there ...
The code he posted will only print the chat messages if the player has ADMIN_KICK flag, but everyone else can see it.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 04-06-2015 , 17:49   Re: [Help] get_user_flags
Reply With Quote #7

Quote:
Originally Posted by wickedd View Post
The code he posted will only print the chat messages if the player has ADMIN_KICK flag, but everyone else can see it.
Yes!
Syturi0 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-06-2015 , 18:54   Re: [Help] get_user_flags
Reply With Quote #8

Quote:
Originally Posted by Syturi0 View Post
Can you show me the better way please?
The way that you did it in your second post is the best way.

Quote:
Originally Posted by wickedd View Post
The code he posted will only print the chat messages if the player has ADMIN_KICK flag, but everyone else can see it.
No. The prints are only to 'id' so only that player would see it (not everybody). The only thing wrong with the code in the OP is that it's not in a player loop.
__________________

Last edited by fysiks; 04-06-2015 at 18:54.
fysiks is online now
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 03:37.


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