Hello friends i was playing Unreal Tournament 1999 I saw their if you kill two players at a Time Distance of 2 seconds then it show Double Kill if another kill in 2 seconds it show MultiKill then Ultra. Can it be Possible ? in VCMP
Yes. Just keep track of the time of the last kill and see if it's within 2 seconds, then act like you would for a killing spree.
Really easy to do.
Quote from: Thijn on Sep 13, 2015, 04:01 PMYes. Just keep track of the time of the last kill and see if it's within 2 seconds, then act like you would for a killing spree.
Really easy to do.
Yea, Exactly!
Things you need:-
1. A IDEA
2. Some scripting skills
Nice idea
I'm not even sure what's so hard to implement :-\ People scripted these in games since forever. Take CS 1.6 for example.
Unreal Best For Ideas Can i Get Example?
Quote from: FinchDon on Sep 14, 2015, 02:06 AMUnreal Best For Ideas Can i Get Example?
I give you the idea. Execute it. It's really easy if you think about it. Try it.
I'll give you a tiny bit of the logic.
if ( (time() - <lastkilltime killer>) <= 2 ) {
Thank You
@Thijn I will try
I tried Your Code
@Thijn Lol Its Say's Error Expression Expected
Line 921
if ( (time() - <lastkilltime killer>) <= 100 )
Quote from: FinchDon on Sep 14, 2015, 10:23 AMI tried Your Code @Thijn Lol Its Say's Error Expression Expected
Line 921
if ( (time() - <lastkilltime killer>) <= 100 )
*facepalm*
Quote from: Drake on Sep 14, 2015, 10:30 AMQuote from: FinchDon on Sep 14, 2015, 10:23 AMI tried Your Code @Thijn Lol Its Say's Error Expression Expected
Line 921
if ( (time() - <lastkilltime killer>) <= 100 )
*facepalm*
Facepalm
not tested,
make a lastkill in player class or store value somewhere for a player mostly in array
if ( (time() - stats[player.ID].Lastkill) <= 2 ) {
Message("Finchdon finally made it");
}else stats[player.ID].Lastkill = time();
Update1 : stats[player.ID].Lastkill instead of lastkill
Caution:its an untested idea perhaps it works
onScriptLoad()
{
LastKillTime < array(GetMaxPlayers(), null );
}
onPlayerKill( player, killer, reason, bodypart )
{
if ( LastKillTime[killer.ID] == null ) LastKillTime[killer.ID] = time();
if((time()- LastKillTime[killer.ID]) < 1000) // if time is less than 1 sec
{
// your funny script here
}
}
Hehe, the problem is FinnchDon don't have a simple time function....
function time()
{
local t = date();
return ::format(@"%.2d/%.2d/%d - %.2d:%.2d:%.2d", t.day, t.month, t.year, t.hour, t.min, t.sec);
}
else
@Kusanagi I would like to request ya to post your time function
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fwww.quickmeme.com%2Fimg%2F7a%2F7a0184f91b92b0ed95d4f2569e297dda4202c180f1190aebcad34157e5c9de60.jpg&hash=6798c814db5e011fe8fc8a0d469b09cab30e63e5)
Quote from: KAKAN on Sep 14, 2015, 05:16 PMHehe, the problem is FinnchDon don't have a simple time function....
function time()
{
local t = date();
return ::format(@"%.2d/%.2d/%d - %.2d:%.2d:%.2d", t.day, t.month, t.year, t.hour, t.min, t.sec);
}
else @Kusanagi I would like to request ya to post your time function
*facepalm*
time() is standard Squirrel function that will return a unix timestamp. Please, go read the manual some day.
Quote from: Kusanagi on Sep 14, 2015, 11:21 AMCaution:its an untested idea perhaps it works
onScriptLoad()
{
LastKillTime < array(GetMaxPlayers(), null );
}
onPlayerKill( player, killer, reason, bodypart )
{
if ( LastKillTime[killer.ID] == null ) LastKillTime[killer.ID] = time();
if((time()- LastKillTime[killer.ID]) < 1000) // if time is less than 1 sec
{
// your funny script here
}
}
That will never work since you set the value before checking the previous one. This will always return true.
Quote from: Thijntime() is standard Squirrel function that will return a unix timestamp. Please, go read the manual some day.
I thought it was deprecated, sorry
Oh it was GetTIme
And yes, where can i find the manual?
Here: http://squirrel-lang.org/doc/sqstdlib3.html
@Beztone i tried your code But When i kill first time it show Announcemnet Double Kil as i add announcement but it show on first kill
Quote from: ThijnThat will never work since you set the value before checking the previous one. This will always return true.
1st read this all
@Thijn i already mention that was an untested idea
Quote from: FinchDon on Sep 15, 2015, 09:30 AM@Beztone i tried your code But When i kill first time it show Announcemnet Double Kil as i add announcement but it show on first kill
did you tried mine?
He just can't understand what u meant
Tested, Nice idea
function onScriptLoad(){
stats <- array( GetMaxPlayers(), 0 );
print(" Debian Loaded" );
}
function onPlayerJoin( player ){
stats[ player.ID ] = PlayerClass( player.Name );
}
function onPlayerPart( player, reason ){
stats[ player.ID ] = null;
}
class PlayerClass{
// ------------------------------------------------------------------- //
Lastkill = 0;
Killcount = 0;
}
function onPlayerKill( killer, player, reason, bodypart )
{
if ( (time() - stats[killer.ID].Lastkill) <= 2 ) {
stats[killer.ID].Killcount++;
Message(killer.Name + "has killed "+stats[killer.ID].Killcount+"players in 2s time.");
}else {
stats[killer.ID].Lastkill = time();
stats[killer.ID].Killcount = 1;
}
}
Update 1 : player.ID to killler.ID