Sending player to spec
Moderator: Moderators
Sending player to spec
Is it possible and without giving to much away at beginning of this post how would I go about sending people to spec once they have reached their 60 kill limit for the map.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
It's very hard to detect kills accurately. I managed to do this but I don't like to share this information unless you can tell me what you're trying to do with itsdlall wrote:Is it possible and without giving to much away at beginning of this post ....
However the spectator thing is very possible.
Code: Select all
local.player spectatorOur official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
HeavenBound
- Colour Sergeant
- Posts: 85
- Joined: Thu Sep 11, 2008 12:55 am
Yeap excatly what I am trying to do as HeavenBound explained. I run serverwatch which can detect when player gets ahead by so many kills but does not detect a stopping point. If that makes any sense. I am wondering if it is possible and what route I should take to conquer this script. Maybe just little insight, SOR into your magic script book.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Ah, don't get me started. Too late!
Foresight, serverwatch, autokick... it's all ineffective crap. DMW? After 4 hours that piece of crap still didn't scan all players on the server (stranded at number 5 lol). MAM? Impressive scripting but it's just pointless.
I never use any of these. Players can cheat all they want on my server. Fine by me, they add a new challenge. However I don't tollerate spawnkilling at all for some reason!
Okay, so I'll share it with you all, I made a standalone script a long time ago.
Just execute this and check the player's kills by his new property: .killcount. You can also detect his deaths with: .deathcount.
EDITED:
Hm, my live detection is also in there... If you ever need to be sure a player is playing in your scripting, execute the mark_live thread and check for .status == "alive".
Foresight, serverwatch, autokick... it's all ineffective crap. DMW? After 4 hours that piece of crap still didn't scan all players on the server (stranded at number 5 lol). MAM? Impressive scripting but it's just pointless.
I never use any of these. Players can cheat all they want on my server. Fine by me, they add a new challenge. However I don't tollerate spawnkilling at all for some reason!
Okay, so I'll share it with you all, I made a standalone script a long time ago.
Just execute this and check the player's kills by his new property: .killcount. You can also detect his deaths with: .deathcount.
EDITED:
Code: Select all
//=============================================
//
// KILLED and DEATH logic for multiplayer
//
// --------------------------------------------------
// How to access player kill and death count:
//
// The player variable: .killcount for kills
// The player variable: .deathcount for deaths
//
// Do not change any of the following player variables:
// - killcount
// - deathcount
// - detect
//
// --------------------------------------------------
// Use: Put this before waittill spawn in your mapscript
//
// exec global/killed_player.scr
//
// --------------------------------------------------
// This script unfortunately cannot detect if a player fell to his doom
// or if he has been killed by a script.
//
// =============================================
//
main:
level waittill spawn
thread mark_live
waitframe
thread kill_handler
end
/**************************
Mark Live Players
------------------
This thread marks all living players
with .status = "alive" and all dead/non-playing
players with .status = "notalive"
*/
mark_live:
while (1)
{
for (local.i = 1; local.i <= $player.size; local.i++)
{
if ( (isAlive $player[local.i]) && $player[local.i].dmteam != "spectator")
{
$player[local.i] weaponcommand dual targetname ("w" + $player[local.i].entnum)
local.weapon = $("w" + $player[local.i].entnum )
if(local.weapon != NULL)
{
local.weapon targetname ""
$player[local.i].status = "alive"
}
else
{
$player[local.i].status = "notalive"
}
}
else
{
$player[local.i].status = "notalive"
}
}
wait 0.1
}
end
kill_handler:
while(1)
{
if ($player.size > 0)
{
for (local.i = 1; local.i <= $player.size; local.i++)
{
if ($player[local.i].detect == NIL || $player[local.i].detect == NULL)
{
if ($player[local.i].status == "alive")
{
$player[local.i] waitthread setup_kill
}
}
}
}
wait 0.5
}
end
//Based on giffe's death detection
setup_kill:
if(self.detect != NIL && self.detect != NULL)
{
self.detect remove
}
self.detect = spawn trigger_multipleall "spawnflags" "128"
self.detect.origin = self.origin
self.detect.angle = self.angle
self.detect setthread killed
self.detect glue self
self.detect.player = self
self.detect.team = self.dmteam
self.detect.alive = 1
self.detect.attacker = NIL
self.detect setsize ( -17 -17 0 ) ( 17 17 92 )
end
killed:
//self waittill trigger //causes inaccuracy
local.murderer = parm.other
//check if player is still on the server or on the same team
if (self.player == NIL || self.player == NULL)
{
self remove
end
}
if ( self.alive == 0 || self.player.dmteam == "spectator")
{
end
}
//MAIN KILL-HANDLER
if ( isAlive self.player != 1 && self.alive == 1 )
{
self nottriggerable
self.alive = 0
self.attacker = local.murderer
waitframe
//benzin barrel
if (local.murderer == NULL)
{
if (self.player.deathcount == NIL)
self.player.deathcount = 0
self.player.deathcount++
end
}
//committed suicide or teamkill
if ( local.murderer == self.player || local.murderer.dmteam == self.player.dmteam )
{
if ( local.murderer.killcount == NIL )
{
local.murderer.killcount = 0
local.murderer.killcount--
}
else if ( local.murderer.killcount != NIL )
{
local.murderer.killcount--
}
}
//no traitor
else if ( local.murderer.dmteam != self.player.dmteam )
{
if ( local.murderer.killcount == NIL )
{
local.murderer.killcount = 0
local.murderer.killcount++
}
else if ( local.murderer.killcount != NIL )
{
local.murderer.killcount++
}
}
if (self.player.deathcount == NIL)
self.player.deathcount = 0
self.player.deathcount++
self immediateremove
}
end
Last edited by $oldier Of Ra on Tue Apr 21, 2009 9:14 pm, edited 6 times in total.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
HeavenBound
- Colour Sergeant
- Posts: 85
- Joined: Thu Sep 11, 2008 12:55 am
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Ah, you're trying to understand the script. Something worth knowing then is this: a trigger with spawnflags 128 detects explosions and player bullets.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
Fairly new at all this so was wanting to get idea on how to setup that. Since you showed me now trying to pick it apart and understand it so that I can try to write the part where once a player reachs 60 puts them in spec. for the rest of the time on that map until the next map starts. But guess would work to if they reached 60 and it put them in spec with a message and if they came out and killed someone then it would just do it all over again. I think even that would deter someone from keep coming out until next map start.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Well you don't have to, just put it in a new script and execute it (from dmprecache, mapscript...). All you then have to do is continuously check if a playe has got 60 kills or more ( .killcount property) and send them to spectator.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
-
Rookie One.pl
- Site Admin
- Posts: 2752
- Joined: Fri Jan 31, 2003 7:49 pm
- Location: Nowa Wies Tworoska, Poland
- Contact:
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
I changed a few small things in the kill-detection script I posted above, I suggest you overwrite the one you have with the new one. It seemed this standalone version wasn't really up-to-date with the one I'm using in my spawn detection.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
Looking over the changed one now and reading reference guide for the millionth time. I appreciate at all the time you have put into this posting and just about ready to call this post dead. I think I am over my head in local ++ < threads { and etc. The only thing I am sure of is that your script was the hard part and what I should be writing is simple and probably not as long but just having no luck in even starting on it. Going to keep trying for now or for at least 1 ++ day.
is the local.i the client number if not what does that stand for
is the local.i the client number if not what does that stand for
Last edited by sdlall on Tue Apr 21, 2009 9:38 pm, edited 1 time in total.
-
$oldier Of Ra
- Lieutenant Colonel
- Posts: 404
- Joined: Sun Oct 16, 2005 7:16 pm
- Location: Belgium
- Contact:
Then it seems to me that you don't know how for statements work nor what arrays are if you're way over your head about that 
You should do something like this:
Well, the script wasn't hard, just finding the method to count kills (and deaths) as accurately as possible was harder. As you can read in the script, I based myself on GiffE's death logic script.
You should do something like this:
Code: Select all
spec_kick:
exec global/killed_player.scr //my script
level waittill spawn
while(1)
{
for (local.i = 1; local.i <= $player.size; local.i++)
{
if ($player[local.i].killcount != NIL && $player[local.i].dmteam != "spectator" && $player[local.i].killcount >= 60)
{
$player[local.i] iprint "You have killed enough players for this match!" 1
$player[local.i] spectator
wait 0.3
}
}
wait 1.5
}
endOur official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)
For all your bot needs!!!!
$oldier Of Ra.

