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

If admin, then...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Grey Echo
Senior Member
Join Date: Nov 2008
Location: United States
Old 02-19-2009 , 20:48   If admin, then...
Reply With Quote #1

Hey guys,

I'm looking for a simple "if user is admin, then execute..." statement. Basically, I want to give my admins cash each round, but in order to do that, I need to be able to identify which players are admins and which ones aren't.

Unfortunately, I don't know my way around SourceMod like I do EventScripts, so I have no idea how to do this. Is there a simple way of going about this?

Thanks in advance.
Grey Echo is offline
Lebson506th
Veteran Member
Join Date: Jul 2008
Old 02-19-2009 , 23:19   Re: If admin, then...
Reply With Quote #2

PHP Code:
for(new 1<= MaxClientsi++) {
    if(
IsClientInGame(i)) {
        if(
GetUserAdmin(i) != INVALID_ADMIN_ID) {
            
// Client is an admin (has generic admin flag), do stuff
        
}
    }

__________________
My Plugins
Spray Tracer by Nican, maintained by me
Simple TK Manager
DoD:S Admin Weapons

Links
Resistance and Liberation (A HL2 Multiplayer Modification)

Last edited by BAILOPAN; 03-10-2009 at 02:50.
Lebson506th is offline
Grey Echo
Senior Member
Join Date: Nov 2008
Location: United States
Old 02-20-2009 , 14:41   Re: If admin, then...
Reply With Quote #3

This is exactly what I was looking for! Thank you very much, mate.
Grey Echo is offline
Doggie52
Senior Member
Join Date: Jul 2007
Location: Sweden
Old 04-08-2009 , 07:27   Re: If admin, then...
Reply With Quote #4

Now, if you were to go one step further you would specify a conditional for the flags of the admin too...
__________________
Quote:
Originally Posted by Iltafragit View Post
4kg ram i5 processor
Doggie52 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 09:10.


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