AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [EASY] How to make something for admin only (https://forums.alliedmods.net/showthread.php?t=277358)

New and Clueless 01-07-2016 15:56

[EASY] How to make something for admin only
 
can you make this for admin only? thanks!

Spoiler

aSior 01-07-2016 17:01

Re: [EASY] How to make something for admin only
 
Which admin flag you want it to be on?

New and Clueless 01-08-2016 02:57

Re: [EASY] How to make something for admin only
 
Quote:

Originally Posted by aSior (Post 2381041)
Which admin flag you want it to be on?

i know how to change a flag :P, id like it on 'u' please, thanks man.

OciXCrom 01-08-2016 07:02

Re: [EASY] How to make something for admin only
 
Simply add the following where all the checks are (you can easily spot them):

PHP Code:

if(!(get_user_flags(attacker) & ADMIN_MENU)) return HAM_IGNORED


aSior 01-08-2016 09:32

Re: [EASY] How to make something for admin only
 
You can add

#define FLAG ADMIN_LEVEL_H
in .sma file, then you just need to compile it ;)

OciXCrom 01-08-2016 10:02

Re: [EASY] How to make something for admin only
 
Quote:

Originally Posted by aSior (Post 2381211)
You can add

#define FLAG ADMIN_LEVEL_H
in .sma file, then you just need to compile it ;)

You sure that that's the only thing he needs to do? :nono:

New and Clueless 01-08-2016 10:19

Re: [EASY] How to make something for admin only
 
Quote:

Originally Posted by OciXCrom (Post 2381223)
You sure that that's the only thing he needs to do? :nono:

could you do it if you dont mind? then ill check and compare to see what you did

OciXCrom 01-08-2016 13:48

Re: [EASY] How to make something for admin only
 
I don't have to check it, I know that it wouldn't do anything. Add the code that I told you to, you don't need anything else.

siriusmd99 01-08-2016 17:41

Re: [EASY] How to make something for admin only
 
Add under OnTakeDamagePost:

if(!is_user_admin(attacker)) return HAM_IGNORED

New and Clueless 01-09-2016 12:30

Re: [EASY] How to make something for admin only
 
Quote:

Originally Posted by siriusmd99 (Post 2381365)
Add under OnTakeDamagePost:

if(!is_user_admin(attacker)) return HAM_IGNORED

your one had error compile, didnt recognise your line

Quote:

Originally Posted by OciXCrom (Post 2381177)
Simply add the following where all the checks are (you can easily spot them):

PHP Code:

if(!(get_user_flags(attacker) & ADMIN_MENU)) return HAM_IGNORED


your one work perfect. but i didnt know where a check was so i was asking if you could put it in the code, and i would then look at the code i posted and the one you would post to see what you changed in it, so next time i would know what a check is


All times are GMT -4. The time now is 09:27.

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