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

Spectate fix plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MAVERICK03191989
Member
Join Date: Dec 2011
Location: VA, USA
Old 05-20-2012 , 00:55   Spectate fix plugin
Reply With Quote #1

hi,

I found this plugin:

Code:
#include amxmodx
#include fakemeta

#define HUD_OFFSET 296

public plugin_init()
{
	register_menucmd(register_menuid("Spectate Menu"),(1<<0)|(1<<1),"Spectate_Menu")

	register_event("DeathMsg","spectate_death","a")
	register_event("ResetHUD","re_spectate","be")

	register_clcmd("say spec","ShowMenu",-1,"Shows The menu")
	register_clcmd("say spectate","ShowMenu",-1,"Shows The menu")
	register_clcmd("say /spec","ShowMenu",-1,"Shows The menu")
	register_clcmd("say /spectate","ShowMenu",-1,"Shows The menu")

	register_concmd("spectate","hook_spectate")
	register_concmd("spec","hook_spectate")

	register_cvar("allow_spectators","1")

}

public Spectate_Menu(id,key)
{
	switch(key)
	{
		case 0:
		{
			client_cmd(id,"spectate")
			ShowMenu(id)
		}
		case 1:
		{
			//exit ?
		}
	}
}

public ShowMenu(id)
{
	static keys, MenuBody[256], Len

	keys = (1<<0|1<<1)
	Len = format(MenuBody,255,"Spectate Menu^n^n")

	Len += format(MenuBody[Len],255-Len,"^n1. Spectate Players And Play Game^n")
	Len += format(MenuBody[Len],255-Len,"^n2. Exit")

	show_menu(id,keys,MenuBody,-1)
}

public spectate_death(id)
{
	static victim

	victim = read_data(2)

	ShowMenu(victim)
}

public re_spectate(id)
{
	show_menu(id,0,"^n",1) 
}

public hook_spectate(id)
{
	if(pev(id,pev_iuser1) || pev(id,pev_iuser2))
{
	spawn_player(id) 
		
	return PLUGIN_HANDLED
}
	return PLUGIN_CONTINUE
}

spawn_player(id) 
{
	set_pev(id,pev_deadflag,DEAD_RESPAWNABLE)
	dllfunc(DLLFunc_Spawn,id)
	set_pev(id,pev_iuser1,0)
	set_pev(id,pev_iuser2,0)
	set_pdata_int(id,HUD_OFFSET,0)
   
	static TeamInfo[16]
	get_user_info(id,"model",TeamInfo,charsmax(TeamInfo))
	
	message_begin(MSG_ALL,get_user_msgid("TeamInfo"))
	write_byte(id)
	write_string(TeamInfo)
	message_end()
}
It fixes the spectate thing for HL. It works perfectly , but it shows a menu when you get killed, and sometimes it messes up the map vote menu when it's time to choose a map . So all i want is the spectate menu off . I mean "No menu"
__________________
MAVERICK03191989 is offline
Send a message via MSN to MAVERICK03191989
MAVERICK03191989
Member
Join Date: Dec 2011
Location: VA, USA
Old 05-27-2012 , 15:06   Re: Spectate fix plugin
Reply With Quote #2

Never mind! Thanks anyway. I found what I wanted.
__________________
MAVERICK03191989 is offline
Send a message via MSN to MAVERICK03191989
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 05-28-2012 , 04:07   Re: Spectate fix plugin
Reply With Quote #3

http://aghl.ru/forum/viewtopic.php?f=19&t=16
__________________
The functional way is the right way
GordonFreeman (RU) 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 12:47.


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