Page 1 of 1

Spectators Respawning

Posted: Sun Oct 12, 2008 5:59 pm
by slmclarengt
Ok, I've heard this is an issue and I've investigated it myself in the lovely world of code ;-).

In shared.inl:

Code: Select all

public SHARED_IsOnTeam( id )
{
	new iTeam = get_user_team( id );

	// Counter-Strike or Condition Zero Check
	if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
	{
		if ( iTeam == CTS || iTeam == TS )
		{
			return true;
		}
	}

	// Day of Defeat Check
	else if ( g_MOD == GAME_DOD )
	{
		if ( iTeam == ALLIES || iTeam == AXIS )
		{
			return true;
		}
	}

	return false;
}
I recommend the following amendment(s):

Code: Select all

public SHARED_IsOnTeam( id )
{
	new team[2]
	get_user_team(id,team,1);

	// Counter-Strike or Condition Zero Check
	if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
	{
		if ( team[0] == 'C' || team[0] == 'T' )
		{
			return true;
		}
	}

	// Day of Defeat Check
	else if ( g_MOD == GAME_DOD )
	{
		if ( iTeam == ALLIES || iTeam == AXIS )
		{
			return true;
		}
	}

	return false;
}
I am merely trying to find a way to stop people from respawning using scroll of respawn when they are spectating. I am not an avid programmer but still putting forth an effort. I would like to know if this is not right (I'm not using it because I'm concerned it's wrong ;-)) and if not, how can this be accomplished?

Btw, this is using the latest binaries from the SVN as of ~4:30PM.

Slmclarengt aka sleeper @ bndclan.com

Re: Spectators Respawning

Posted: Mon Oct 13, 2008 12:45 am
by whosyourdaddy
wait are u saying that you can buy a scroll when ur in spectate mode?

Re: Spectators Respawning

Posted: Mon Oct 13, 2008 10:15 pm
by Geesu
@ slmclarengt

I *believe* this is not a bug w/that function - but rather a bug with the spawn() function in HL. Sometimes you will spawn w/o a HUD - and you're on "spectator" team - kind of.

It's f'ed up... but you should never be able to buy a scroll while in spectator - if you can prove me wrong pls show a demo :P

Re: Spectators Respawning

Posted: Tue Oct 14, 2008 1:40 pm
by slmclarengt
I don't actually play much in my own server but many people do. I think I found out the respawning as spectator has nothing to do with WC3 but rather with amx_super's function amx_revive.

Thanks,

Slmclarengt

Re: Spectators Respawning

Posted: Wed Oct 15, 2008 8:54 am
by YamiKaitou
Only if you are spec when you use the command amx_revive will you be respawned as a spectator. There is no bug with this command that effects wc3ft.

Re: Spectators Respawning

Posted: Wed Oct 15, 2008 3:39 pm
by whosyourdaddy
well actually i think i got an idea not sure how well it will work but its a pretty good one, the reason people get the scroll glicth is because they buy it when they lag or ping is over 400 or 500(i believe its 500) i tested it out myself put up downloads and tried buying a scroll and it glicthed me, i think there should be a ping check and if the users ping is greater than 300 then put a set task to check again if not then do the scroll function