Raised This Month: $ Target: $400
 0% 

Alternative to is_user_admin() ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devWaleed
Member
Join Date: Apr 2013
Location: Karachi, Pakistan
Old 04-17-2013 , 14:45   Alternative to is_user_admin() ?
Reply With Quote #1

Em Hi, probably my first post here. I found that is_user_admin() is not showing in funcwiki and It isn't working in my script too, perhaps only for me? :/

PHP Code:
    if(is_user_alive(id) && !is_user_bot(id) && is_user_admin(id) == 0){
        
set_task(float(get_pcvar_num(frequency)), "getdata"id__"b")
    } 
I still get my desired errors for clients which shouldn't been shown if user is admin.

Is there an alternative to it? Or If still is_user_admin() works?

-Thanks.

Last edited by devWaleed; 04-17-2013 at 17:17.
devWaleed is offline
Send a message via Skype™ to devWaleed
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 04-17-2013 , 14:53   Re: Alternative to is_user_admin() ?
Reply With Quote #2

Are you sure you meant to post here? Looks like you're looking for AMXX.
__________________
Dr. McKay is offline
devWaleed
Member
Join Date: Apr 2013
Location: Karachi, Pakistan
Old 04-17-2013 , 14:58   Re: Alternative to is_user_admin() ?
Reply With Quote #3

Oh, I am sorry Sir, I clicked the wrong scripting section, Yes It is meant to be in AMXX section. Sorry. Can you or any mode' move it there, please?
devWaleed is offline
Send a message via Skype™ to devWaleed
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-17-2013 , 16:46   Re: Alternative to is_user_admin() ?
Reply With Quote #4

get_user_flags is not better, is_user_admin is just fine.

Add this after #include <amxmodx> at top of plugin :

#include <amxmisc>
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-17-2013 at 16:48.
ConnorMcLeod is offline
Old 04-17-2013, 15:19
devWaleed
This message has been deleted by ConnorMcLeod. Reason: Same as 1st post (merged)
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-17-2013 , 15:28   Re: Alternative to is_user_admin() ?
Reply With Quote #6

It's native which is NOT included in the base amxmodx.
However you can make it yourself.


BTW,
Code:
set_task(float(get_pcvar_num(frequency)),.....
--->
set_task(get_pcvar_float(frequency),.....

Last edited by didoWEE; 04-17-2013 at 15:30.
didoWEE is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-17-2013 , 16:17   Re: Alternative to is_user_admin() ?
Reply With Quote #7

get_user_flags it's better
baneado is offline
devWaleed
Member
Join Date: Apr 2013
Location: Karachi, Pakistan
Old 04-17-2013 , 17:16   Re: Alternative to is_user_admin() ?
Reply With Quote #8

Ok, but I couldn't find it in funcwiki. Tell me if I am doing this wrong.

To check if user is not an admin.

PHP Code:
if(!is_user_admin(id))  OR  if(is_user_admin(id) == 0
which one is correct? I think both.

Last edited by devWaleed; 04-17-2013 at 17:17.
devWaleed is offline
Send a message via Skype™ to devWaleed
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-17-2013 , 17:35   Re: Alternative to is_user_admin() ?
Reply With Quote #9

I think the more correct is:
if(!is_user_admin(id))
__________________
Jhob94 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-17-2013 , 17:52   Re: Alternative to is_user_admin() ?
Reply With Quote #10

It is rather the same, but boolean check is better.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 10:54.


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