Raised This Month: $ Target: $400
 0% 

How To: Make a Superhero Admin Only


Post New Thread Reply   
 
Thread Tools Display Modes
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-20-2007 , 11:31   Re: How To: Make a Superhero Admin Only
Reply With Quote #11

change this:
Code:
new accessLevel[10] = ADMIN_LEVEL_A //set you admin check level to what you want     /* or make it a cvar     get_cvar_string("mindbender_adminflag", accessLevel, 9)     */
in the admin check function to:
Code:
new accessLevel[10] = get_cvar_string("mindbender_admincheck", accessLevel, 9)
that should work
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 03-20-2007 at 11:35.
Rolnaaba is offline
D4ark
Senior Member
Join Date: Feb 2007
Old 03-20-2007 , 14:11   Re: How To: Make a Superhero Admin Only
Reply With Quote #12

Nope, it didnt work... but it worked when i tryed this:
Changed:

Code:
new accessLevel[10] = ADMIN_LEVEL_A //set you admin check level to what you want
    /* or make it a cvar
    get_cvar_string("mindbender_admincheck", accessLevel, 9)
    */
To:

Code:
new accessLevel[10]

    get_cvar_string("mindbender_adminflag", accessLevel, 9)
Also changed mindbender_admincheck to midnbender_adminflag....
D4ark is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-21-2007 , 08:36   Re: How To: Make a Superhero Admin Only
Reply With Quote #13

that is what I meant lol, that = sign was supposed to be a semi colon
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
D4ark
Senior Member
Join Date: Feb 2007
Old 03-21-2007 , 10:10   Re: How To: Make a Superhero Admin Only
Reply With Quote #14

w/e.. but u should change the admincheck cvar to adminflag...
D4ark is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-21-2007 , 13:16   Re: How To: Make a Superhero Admin Only
Reply With Quote #15

ADMIN_LEVEL_A is not a string.
ADMIN_LEVEL_A is equal to "m" flag

Last edited by [ --<-@ ] Black Rose; 03-21-2007 at 13:20.
[ --<-@ ] Black Rose is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-22-2007 , 08:39   Re: How To: Make a Superhero Admin Only
Reply With Quote #16

@D4ark
you registered it as admincheck in plugin_init:
Code:
register_cvar("mindbender_admincheck", "a" )
wouldnt level ADMIN_LEVEL_A be "a" flag?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
D4ark
Senior Member
Join Date: Feb 2007
Old 03-22-2007 , 10:19   Re: How To: Make a Superhero Admin Only
Reply With Quote #17

i didnt register it as mindbender_admincheck.... i said i changed it to mindbender_adminflag, it wouldnt work with admincheck, or atleast i couldnt make it work with it, so i changed all of that to mindbender_adminflag...
D4ark is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-22-2007 , 10:31   Re: How To: Make a Superhero Admin Only
Reply With Quote #18

ok...then change your get_cvar_string to the same.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
D4ark
Senior Member
Join Date: Feb 2007
Old 03-22-2007 , 10:46   Re: How To: Make a Superhero Admin Only
Reply With Quote #19

i did, and i already said it worked....
D4ark is offline
MonkeyMan
New Member
Join Date: Apr 2007
Old 04-08-2007 , 18:12   Re: How To: Make a Superhero Admin Only
Reply With Quote #20

im trying to make silver surfer an admin only hero, im completly codeing illiteralte, so here's my code, anyhelp would be great on geting it to work
Code:
public surfer_init() {
    new temp[6];
    read_argv(1,temp,5);
    new id = str_to_num(temp); //get players index
 
    read_argv(2,temp,5);
    new hasPowers = str_to_num(temp); //check if they have your power
 
    gHasSurferPower[id] = (hasPowers != 0); //set have power
    gSurferSelected[id] = gHasSurferPower[id];
 
    if(gHasSurferPower[id] && is_user_connected(id)) { //if they have your power and are connected do admin check
          Surfer_admincheck(id);
    }
}
public Surfer_admincheck(id) { //admin check function
    new accessLevel[10] = "a" //set you admin check level to what you want
    /* or make it a cvar:
    get_cvar_string("HERO_adminflag", accessLevel, 9)
    */
 
    if ( gSurferSelected[id] &&  !(get_user_flags(id)&read_flags(accessLevel)) ) {
          client_print(id, print_chat, "[SH](%s) **Admin Only** You are not authorized to use this hero", gSurfername)
          gHasSurferPower[id] = false
          client_cmd(id, "say drop %s", gSurferName)
    }
}
MonkeyMan 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 01:16.


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