2\14\12 - Updated and packaged by armageddon
To make this work, you must be logged in as Admin using the Reborn admins.ini file, and using Reborn 2.5 Gamma+
Then, in the game,
if you want to watch player number 7 for example. type in console : keyp 1007
if you want to watch player number 14 for example. type in console : keyp 1014 ,etc...
It would be easier to put this command in an admin menu. For client 7, stuffcommand keyp 1007 or client 14 stuffcommand keyp 1014, etc...
To stop watching a player, press the Use key or Mouse button.
I made the keyp 1000-1031 for a 32 slot server in global/keypresshandler.scr
If you are using global/dmprecache.scr for other mods, then add this line to it.
Code:
local.result = registerev "keypress" global/keypresshandler.scr //This will let Reborn know to execute that .scr file whenever a client sends a keyp command.
DOWNLOAD
2\13\12
This is Elgan's work (Nice job Elg), with the help from the team for brainstorming...
Here we go..
@Elgan, if you need me to update this post, just let me know!
-----------------------------------------------------------------------
NOW THIS....
should give the admin a message when the spectated , suspected player is looking / aiming/ firing at a player...and through a wall..
"aiming at playername through wall"
"firing at playername through wall"
or just
"aiming at playername"
"firing at playername"
...now this I did through on my bros moh to quickly test..it sort is ok but a bit crude...not brilliant detection.
Code:
spec:
local.admin = $player[2]
local.player = $player[1]
if( local.admin == NULL || local.admin == NIL)
{
end
}
if( local.player == NULL || local.player == NIL)
{
end
}
local.inradius = vector_within local.admin.origin local.player.origin 130
local.camera = spawn Camera
local.camera targetname ("cam" + local.player.entnum)
local.camerause = spawn trigger_camerause target ("cam" + local.player.entnum)
local.camerause doUse local.admin
local.sorigin = spawn script_origin targetname "origin"
local.sorigin notsolid
local.camera notsolid
while(1)
{
waitframe
local.CAMorigin = local.player.origin - local.player.forwardvector * 100 + ( 0 0 100 )
//trace back to make sure its valid
local.CAMorigin = trace ( local.player.origin + ( 0 0 100 )) local.CAMorigin
local.ENTorigin = local.player.origin + ( 0 0 70 )
// local.sorigin.origin = waitthread setheight local.ENTorigin ( local.player.origin[2] + 100 )
local.camera.origin = waitthread setheight local.CAMorigin ( local.player.origin[2] + 100 )
local.sorigin.origin = local.player.origin + angles_toforward local.player.viewangles * 100
local.sorigin.origin += ( 0 0 100 ) //what we are abiove
//the only way to make this not "jault" more is to smooth angle difference...something like...
// then get the cameras viewangles and make them head toward the new..
//localnewangles_viewangles = angled_topointatw(local.admin.origin)
// quite frankly would get a little silly...and I cant remember the cmd off the top of my view to get angles looking at an ant.
// OR make an ent and move it with the player but smoother, same as this and make the camera look at that.
//local.camera lookat local.admin
local.camera lookat local.sorigin
//are we looking at a player
waitthread looking_at_player local.player local.admin
}
end
setheight local.origin local.dist:
local.height = local.origin[2]
if(local.height > local.dist)
{
local.dist = local.height - local.dist
local.dist = local.dist / 100 * 10
local.height -= local.dist
}
else if(local.height < local.dist)
{
local.dist = local.dist - local.height
local.dist = local.dist / 100 * 10
local.height+= local.dist
}
local.origin[2] = local.height
end local.origin
looking_at_player local.suspect local.admin:
level.PLAYERWIDTH = 35 // half a player width?
for(local.i = 1;local.i <= $player.size;local.i++)
{
local.player = $player[local.i]
if(local.player != local.suspect)
{
local.vector_dist = ( local.player.origin - local.suspect.origin ) // get vector between distance?
local.distance = vector_length( local.player.origin - local.suspect.origin ) // get vector between distance?
//player is local.distance away from player under spec
//get the point equal distance away from the centre of the suspects view
//local.centroid = local.suspect.origin + (local.suspect.forwardvector * local.distance )
local.centroid = local.suspect.origin + angles_toforward local.suspect.viewangles * local.distance
//get how far accros we can see at this distance.
iprintln local.distance
//no...check to see if the player is what we are aiming at.
// 30
local.distance_from_centroid = vector_length( local.player.origin - local.centroid )
if(local.distance_from_centroid <= level.PLAYERWIDTH)
{
local.name = netname local.player
if( ! (local.suspect cansee local.player))
{
local.isthroughwall = " through a wall"
}
else
{
local.isthroughwall = ""
}
if(local.suspect.fireheld == 1)
{
local.aiming = "Firing at "
}
else
{
local.aiming = " Aiming at "
}
//hud print this might be BETTER
local.admin iprint (local.aiming + local.name + local.isthroughwall) 1
}
}
}
end