Raised This Month: $ Target: $400
 0% 

Help on making a hero admin-only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
StevnJ9971
Senior Member
Join Date: Sep 2006
Location: California
Old 03-03-2007 , 20:31   Help on making a hero admin-only
Reply With Quote #1

Hey guys, I know there's been a lot of topics like this, but I've looked at all of them and can't figure out for the life of me how to do it. I've searched up and down the forums and tried to figure out what makes Uncle Sam work, but it's all foreign to me.

I can't figure out what line to put where. I really just need a simple fix, as all I'm trying to do is make Bass and Casper admin only (with the immunity tag).

Thanks in advance.
__________________
[IMG]http://img208.**************/img208/1706/userbar262772da7.gif[/IMG]
StevnJ9971 is offline
Send a message via AIM to StevnJ9971
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-04-2007 , 04:12   Re: Help on making a hero admin-only
Reply With Quote #2

Code:
public HERO_init() {    new temp[6]    read_argv(1,temp,5)    new id = str_to_num(temp)        read_argv(2,temp,5)    new hasPowers = str_to_num(temp)        gHasHEROPower[id] = (hasPowers != 0)    gHEROSelected[id] = gHasUncleSamPower[id]        if(gHasHEROPower[id] && is_user_connected(id)) {       HERO_admincheck(id)    } } public HERO_admincheck(id) {    new accessLevel[10] = ADMIN_LEVEL_A    if ( gUncleSamSelected[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", gHEROName)       gHasHEROPower[id] = false       client_cmd(id, "say drop %s", gHEROName)    } }
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
StevnJ9971
Senior Member
Join Date: Sep 2006
Location: California
Old 03-04-2007 , 10:46   Re: Help on making a hero admin-only
Reply With Quote #3

And that goes anywhere in the code?
__________________
[IMG]http://img208.**************/img208/1706/userbar262772da7.gif[/IMG]
StevnJ9971 is offline
Send a message via AIM to StevnJ9971
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 03-04-2007 , 11:13   Re: Help on making a hero admin-only
Reply With Quote #4

Srry stevn, but do u even understand that code?
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
StevnJ9971
Senior Member
Join Date: Sep 2006
Location: California
Old 03-04-2007 , 11:16   Re: Help on making a hero admin-only
Reply With Quote #5

To tell you the truth, not really. I'd really appreciate if someone could explain to me lol. I'm not a coder, but really want to be able to make a hero admin-only.
__________________
[IMG]http://img208.**************/img208/1706/userbar262772da7.gif[/IMG]
StevnJ9971 is offline
Send a message via AIM to StevnJ9971
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-05-2007 , 08:38   Re: Help on making a hero admin-only
Reply With Quote #6

in your hero's init func add this:
Code:
if(gHasHEROPower[id] && is_user_connected(id)) {    HERO_admincheck(id) }
then use the HERO_admincheck func I made earlier
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
StevnJ9971
Senior Member
Join Date: Sep 2006
Location: California
Old 03-09-2007 , 23:27   Re: Help on making a hero admin-only
Reply With Quote #7

Sorry for the noob question (I don't code). What does the color-coding mean?
__________________
[IMG]http://img208.**************/img208/1706/userbar262772da7.gif[/IMG]
StevnJ9971 is offline
Send a message via AIM to StevnJ9971
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-13-2007 , 11:54   Re: Help on making a hero admin-only
Reply With Quote #8

just highlioghting to make easier to read
ex: in the studio (amxx studio) strings are highlighted red, variables/unknown = blue, define/comment = orange, ect. easier to read
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
StevnJ9971
Senior Member
Join Date: Sep 2006
Location: California
Old 03-13-2007 , 23:01   Re: Help on making a hero admin-only
Reply With Quote #9

Oh, okay. Thanks Rolnaaba.
__________________
[IMG]http://img208.**************/img208/1706/userbar262772da7.gif[/IMG]
StevnJ9971 is offline
Send a message via AIM to StevnJ9971
StevnJ9971
Senior Member
Join Date: Sep 2006
Location: California
Old 04-22-2007 , 12:12   Re: Help on making a hero admin-only
Reply With Quote #10

So rolnaaba, I can't figure out where to put the code... I tried to figure it out, but I just can't for the life of me figure out where to put it.
__________________
[IMG]http://img208.**************/img208/1706/userbar262772da7.gif[/IMG]
StevnJ9971 is offline
Send a message via AIM to StevnJ9971
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:43.


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