Raised This Month: $ Target: $400
 0% 

Help Please !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
akdteam
Member
Join Date: Jan 2009
Old 05-12-2011 , 21:30   Help Please !
Reply With Quote #1

I need help whit this plugin...

https://forums.alliedmods.net/showpo...9&postcount=49

The file configuration is located in shconfig but not work...

;This file is used to tell sh_adminrestrict which heros are restricted to specific user flags, ;i.e. admin/vip

;it should be located in the configs/shero/ directory

;Basic format is as follows
;!<flags>
;<heroname1> <heroname2> heros which are restricted by the specified flags
;<heroname3> ... can also seperate by newline not just space if need be

;you can create more than 1 group for a specific set of flags i.e. you can set differant levels of admin restricted heros (vip, lower admin, higher admin, etc)
;though if you want a particular hero to be used by 2 or more groups, do not list the hero in both groups as that will glitch the plugin, instead create a
;new group with both sets of flags(i.e. say one group is restricted to flag t and another to b then set the new one to bt)
;keep in mind that hero's which are more than 1 word long should be put in between "" so plugin doesn't assume otherwise
;Example usage:

;!t
;Anubis Bass Beast "Black Panther"
;Bazooka BombSquad

i.e. admin/vip
!a
Penguin

Thanks.
akdteam is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 05-13-2011 , 08:57   Re: Help Please !
Reply With Quote #2

just to make sure, did you follow the instruction's listed at the top of the plugin
Code:
there are 2 minor issues with superhero we need to change before this plugin works completly. 
p.s. the === signifies a block of code, when it says to add don't include the === above and below the actual code.

1. the older style heros won't properly be detected because superhero doesn't send the sh_hero_init forward when they are used, instead it only sends the server message.  If you want to use this plugin on older
style hero you must make this change.

open superhero.sma and run a search for this block of code:
=========================================================================================
	//Init the hero
#if defined SH_BACKCOMPAT
	if ( gEventInit[heroIndex][0] != '^0' ) {
		server_cmd("%s %d %d", gEventInit[heroIndex], id, mode)
	}
	else {
#endif
		ExecuteForward(fwd_HeroInit, fwdReturn, id, heroIndex, mode)

#if defined SH_BACKCOMPAT
	}
#endif

	gChangedHeroes[id] = true
=========================================================================================

and replace it with this
=========================================================================================
//Init the hero
#if defined SH_BACKCOMPAT
	if ( gEventInit[heroIndex][0] != '^0' ) {
		server_cmd("%s %d %d", gEventInit[heroIndex], id, mode)
	}
#endif
	ExecuteForward(fwd_HeroInit, fwdReturn, id, heroIndex, mode)

	gChangedHeroes[id] = true
=========================================================================================

that takes care of the first issue, now for the second.

2. this plugin requires an extra native to be able to alter hero info and let players know which hero's are special, otherwise they only find out when they pick the hero.
there are 2 ways around this: first, you could manually open up each hero you want to be admin only and edit the info there... or you could make a change to the core so this plugin can do it for you.
If you pick the former, then ignore the proceeding, on the other hand if you prefure the latter:

open superhero.sma and scroll down to plugin_natives.  Copy following line somewhere in the function(prefurably under register_native("sh_set_hero_info", "_sh_set_hero_info") to keep things looking clean)
=========================================================================================
	register_native("sh_get_hero_info", "_sh_get_hero_info")
=========================================================================================

now anywhere in the file(prefurably at the very bottom so you don't accidently mix into another function) add this function
=========================================================================================	
public _sh_get_hero_info(plugin, params)
{
	new heroIndex = get_param(1)

	if ( heroIndex < 0 || heroIndex >= gSuperHeroCount ) return 0

	set_string(2, gSuperHeros[heroIndex][superpower], get_param(3))		//Short Power Description
	set_string(4, gSuperHeros[heroIndex][help], get_param(5))		//Help Info

	return 1
}
=========================================================================================

close superhero.sma and recompile(drag and drop it on compile.exe) then in this file uncomment the #define CHANGE_INFO line and compile this as well.
because while step 2 is optional, step 1 is mandatory to fix an issue with older style heroes not properly sending the init message to the plugin. After looking, Penguin is still coded using the old api methods so it's exactly the type hero that fix was intended for.

p.s. reason I never made a separate thread for the plugin is because of the fact that it requires these modification's to superhero. If the natives I altered/added made their way into the next released version of superhero then I would actually create a thread for the plugin.
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
akdteam
Member
Join Date: Jan 2009
Old 05-13-2011 , 15:26   Re: Help Please !
Reply With Quote #3

Ok that do the second modification my sma is

register_native("sh_set_hero_info", "_sh_set_hero_info")
register_native("sh_get_hero_info", "_sh_get_hero_info")

(REPEAT (?))

The plugin work but not restrict the heroe when user is alive.

Sorry for my bad english.
akdteam is offline
AtToViDe
Member
Join Date: Nov 2009
Location: czech republic
Old 04-27-2013 , 13:25   Re: Help Please !
Reply With Quote #4

add scipt no delete in superhero.sma only add i have and work
__________________
AtToViDe 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 23:23.


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