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

How To: Make a Superhero Admin Only


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

thats fine for init and admin check, or so it looks at quick glance
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
MonkeyMan
New Member
Join Date: Apr 2007
Old 04-09-2007 , 08:46   Re: How To: Make a Superhero Admin Only
Reply With Quote #22

every time i complie it it gives me alot of errors, and since i have no idea how to code, i cant debug it unless i have a sheet in front of me telling me what to do , ill post the errors later today, (not at my computer right now)
MonkeyMan is offline
storm007fire
BANNED
Join Date: Apr 2007
Old 04-12-2007 , 04:08   Re: How To: Make a Superhero Admin Only
Reply With Quote #23

well u post the code and let some one fix it sorry for teh bump
storm007fire is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 04-13-2007 , 10:27   Re: How To: Make a Superhero Admin Only
Reply With Quote #24

if code is long then attach .sma and post compiler errors other wise just post both
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-17-2007 , 12:49   Re: How To: Make a Superhero Admin Only
Reply With Quote #25

unfortunately I have to bump this, because I am seeing the question AGAIN! vittu is there anyway you could sticky this and the other SuperHero tut I wrote so people will stop being retarded?
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
MyZna
Member
Join Date: Aug 2007
Old 08-13-2007 , 11:47   Re: How To: Make a Superhero Admin Only
Reply With Quote #26

Sticky this please. It's very useful for a noob like me who accidentally makes overpowered heros, and needs to test all his heroes now with admin only on them so people don't abuse the power.
__________________
I am 68% addicted to Counterstrike. What about you?
MyZna is offline
shockwave
Junior Member
Join Date: Oct 2006
Old 03-16-2008 , 22:20   Re: How To: Make a Superhero Admin Only
Reply With Quote #27

I can Get Mine To Compile It Says That It Has An "Undifined Symbol gHasMichaelPower"

Heres My Code

//Hero Michael

//shconfig.cfg
/*
Michael_level 10
Michael_health 1000 //Health (Default 1000)
Michael_armor 1000 //Armor (Default 1000)
Michael_adminflag a //Checks For Admin Letter a (default a)
*/

//-----------------------------------------------------------------------


//requirements
#include <amxmodx>
#include <superheromod>

//-----------------------------------------------------------------------



//-----------------------------------------------------------------------

new gHeroName[]="Michael"

new bool:gHasMichael[SH_MAXSLOTS+1]

public plugin_init()
//-----------------------------------------------------------------------

{
//Plugin

register_plugin("SUPERHERO Michael", "1.2", "MTD")


//Register Cvarr

register_cvar("Michael_level", "10")

register_cvar("Michael_Health", "1000")//Health

register_cvar("Michael_armor", "1000")//Armor

register_cvar("Michael_adminflag", "a")


//Events

shCreateHero(gHeroName, "Tons Of Admin Health!", "Kill With All Your Health", true, "Michael_level")




//Setting The Hero

shSetMaxHealth(gHeroName, "Michael_Health")//Set Health

shSetMaxArmor(gHeroName, "Michael_Armor")//Set Armour

}

//-----------------------------------------------------------------------
public Michael_init()
{
// First Argument is an id

new temp[6]

read_argv(1,temp,5)

new id = str_to_num(temp)

// 2nd Argument is 0 or 1 depending on whether the id has the hero

read_argv(2,temp,5)

new hasPowers = str_to_num(temp)

if (!hasPowers && gHasMichael[id] && is_user_alive(id)) //Have The Powers?

shRemHealthPower(id)//Remove Hp



if (!hasPowers && gHasMichael[id] && is_user_alive(id)) //Have The Powers?

shRemArmorPower(id)//Remove Armor


gHasMichaelPower[id] = (hasPowers != 0)

gMichaelSelected[id] = gMichaelSamPower[id]



if ( gHasMichaelPower[id] && is_user_connected(id) ) {

Michael_admincheck(id)

}
}
//-----------------------------------------------------------------------

//----------------------------------------------------------------------------------------------

public Michael_admincheck(id)
{

new accessLevel[10]


get_cvar_string("Michael_adminflag", accessLevel, 9)


if ( gMichaelSelected[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)

gHasMichaelPower[id] = false

client_cmd(id, "say drop %s", gHeroName)
}
}



Heres The Sma For Michael if u cant get it from here.......sh_Michael.sma
Attached Files
File Type: sma Get Plugin or Get Source (sh_Michael.sma - 784 views - 2.5 KB)

Last edited by shockwave; 03-17-2008 at 00:51. Reason: change Work to Compile.....
shockwave is offline
NexusReaper69
Member
Join Date: Mar 2008
Old 03-17-2008 , 00:07   Re: How To: Make a Superhero Admin Only
Reply With Quote #28

this doesn't stop other players from picknig the power it just makes them drop it, and if they are alive they aren't allowed to drop heroes, atleast not on my server, how do you make it so that they can't even choose it, like with uncle sam
__________________
NexusReaper69 is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 03-17-2008 , 02:34   Re: How To: Make a Superhero Admin Only
Reply With Quote #29

you cant write gHasMichaelPower in your code if you have registered it to gHasMichael i'm not shore this works but it compile with 2 loose identation
Attached Files
File Type: sma Get Plugin or Get Source (test.sma - 745 views - 2.6 KB)
micke1101 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 03-17-2008 , 08:55   Re: How To: Make a Superhero Admin Only
Reply With Quote #30

Quote:
Originally Posted by NexusReaper69 View Post
this doesn't stop other players from picknig the power it just makes them drop it, and if they are alive they aren't allowed to drop heroes, atleast not on my server, how do you make it so that they can't even choose it, like with uncle sam
This is the exact method that Uncle Sam uses.
__________________
DO NOT PM me about avp mod.
Rolnaaba 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 05:34.


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