[Info] Shoutcast scripts?

User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [Info] Shoutcast scripts?

Post by DaJ4ck3L »

no no, atm it observers the player if he has the flag, or positions the camera above the flag if not on a player. the problem with that is it will show everyone as red indicators, and you can't tell who is what team except for looking at their skins.

https://www.youtube.com/watch?feature=p ... 44yW#t=815

here you can see all the indicators red when the video starts, then when he hits the bind again it shows the caper as green, and enemy team as red. what i would really love to see is when he hits the flag bind, and it's not on a player, then it will show whatever flag he went to as green ind for that team, and other team as red.

Code: Select all

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//  .oooooo.    oooooooooooo    ooooo        oooooooooooo   .oooooo.    oooooooooooo ooooo      ooo oooooooooo.    oooooooooooo//
// d8P'  `Y8b  d'""""""d888'    `888'        `888'     `8  d8P'  `Y8b   `888'     `8 `888b.     `8' `888'   `Y8b  d'""""""d888'//
//888      888       .888P   +   888          888         888            888          8 `88b.    8   888      888       .888P  //
//888      888      d888'   +++  888          888oooo8    888            888oooo8     8   `88b.  8   888      888      d888'   //
//888      888    .888P      +   888          888    "    888     ooooo  888    "     8     `88b.8   888      888    .888P     //
//`88b    d88'   d888'    .P     888       o  888       o `88.    .88'   888       o  8       `888   888     d88'   d888'    .P//
// `Y8bood8P'  .8888888888P      o888ooooood8 o888ooooood8  `Y8bood8P'   o888ooooood8 o8o        `8  o888bood8P'  .8888888888P //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//	Shoutcast v1.1 by DaJ4ck3L
//

function remoteShoutcastF(%clientId, %team, %flagorbit)
{
	%clientId.tries++;
	if(%clientId.tries > 10)
	{
		if(%clientId.gone)
		{
			return;
		}
		%name = client::getName(%clientId);
		Log::Exploit(%clientId, "Server-Crash", "remoteShoutcastF");
		banlist::add(client::getTransportAddress(%clientId), 999);
		kick(%clientId, "You Were Kicked For Spamming remoteShoutcastF");
		%clientId.gone = true;
		return;
	}
	schedule(%clientId@".tries = 0;", 0.5);
	//^^spam protection
	Shoutcast::CheckFlag(%clientId, %team, %flagorbit);
}

function remoteShoutcastP(%clientId)
{
	%clientId.tries++;
	if(%clientId.tries > 10)
	{
		if(%clientId.gone)
		{
			return;
		}
		%name = client::getName(%clientId);
		Log::Exploit(%clientId, "Server-Crash", "remoteShoutcastP");
		banlist::add(client::getTransportAddress(%clientId), 999);
		kick(%clientId, "You Were Kicked For Spamming remoteShoutcastP");
		%clientId.gone = true;
		return;
	}
	schedule(%clientId@".tries = 0;", 0.5);
	//^^spam protection
	Shoutcast::CheckPlayer(%clientId);
}

function Shoutcast::CheckFlag(%clientId, %team, %flagorbit)
{
   if(Client::getTeam(%clientId) != -1 && -1 < %team)
      return;
   
	%flag = $teamFlag[%team];
   	if(-1 < %flag.carrier)
	{
		%target = Player::getClient(%flag.carrier);
		%clientId.observerMode = "observerOrbit";
		Observer::setOrbitObject(%clientId, %target, 10, 10, 10); //give a little extra room for the capper to see what's going on around him.
		bottomprint(%clientId, "<jc>Third Person Observing " @ Client::getName(%target), 5);
		%clientId.observerTarget = %target;
	}
	else
	{
		%clientId.observerTarget = "";
		%clientId.observerMode = "observerFly"; //wish i could've orbited this, but i got lazy. maybe in update.
		Observer::setFlyMode(%clientId, Vector::add(GameBase::getPosition(%flag), "0 0 3"), GameBase::getRotation(%flag), true, true);
	}
}

function Shoutcast::CheckPlayer(%clientId)
{
	if(Client::getTeam(%clientId) != -1)
		return;
	
	if(%clientId.selClient == "")
		return;
	
	if(Client::getTeam(%clientId.selClient) == -1)
		return;
	
	%target = %clientId.selClient;
	%clientId.observerMode = "observerOrbit";
	Observer::setOrbitObject(%clientId, %target, 5, 5, 5);
	bottomprint(%clientId, "<jc>Third Person Observing " @ Client::getName(%target), 5);
	%clientId.observerTarget = %target;
	Client::cancelMenu(%clientId);
}
here is the script atm. what i would love to add is the ability to show red / green ind for when the flag is not on a player. would be nice if something like Observer::setTeam(%cl, %team); worked. sadly it doesn't. the only way i can get green / red ind atm is by orbiting a player. haven't tested yet if orbiting a flag has the same effect, but im guessing it does, since flags have teams too.
Image
User avatar
Fixious
Posts: 475
Joined: Sat Nov 09, 2013 12:42 am

Re: [Info] Shoutcast scripts?

Post by Fixious »

Could the phase shift pack be modified for an observer to lock onto a player when looking at them? Obs don't have crosshairs or anything so it might not be possible.
User avatar
DaJ4ck3L
Crow{OZ}
Posts: 3375
Joined: Thu Jul 22, 2010 11:51 pm
Contact:

Re: [Info] Shoutcast scripts?

Post by DaJ4ck3L »

yea i thought about that, as that's how it is in ta, but no, it would be way to hard. even if i could code it for observer, it would have to use LOS, which means he would have to be a good shot lol. in ta they increase the reticle line of sight for obs.
Image
User avatar
Fixious
Posts: 475
Joined: Sat Nov 09, 2013 12:42 am

Re: [Info] Shoutcast scripts?

Post by Fixious »

Might be nice to display player speed, if possible.
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [Info] Shoutcast scripts?

Post by perrinoia »

GameBase::getLOSInfo() does not work for observers.

However, you can get their position, and maybe their rotation, and then get a vector from the rotation, and add it to the position, and use "getLOSInfo()" from the observer position to the observed position... But as Crow said, the observer would need to have good aim.

Server side speed huds are easy, though.
Image
Post Reply