FinchDon

  • Sr. Member
  • Posts: 252
Can it be possible
« on September 13th, 2015, 04:47 PM »
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
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Thijn

  • VC:MP Beta Tester
  • Posts: 1,688
Re: Can it be possible
« Reply #1, on September 13th, 2015, 05:01 PM »
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.

KAKAN

  • Wiki Contributor
  • Posts: 3,343
Re: Can it be possible
« Reply #2, on September 13th, 2015, 05:17 PM »
Quote from Thijn on September 13th, 2015, 05:01 PM
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.
Yea, Exactly!
Things you need:-
1. A IDEA
2. Some scripting skills
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

Debian

  • Jr. Member
  • Posts: 62

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,807
Re: Can it be possible
« Reply #4, on September 13th, 2015, 05:55 PM »
I'm not even sure what's so hard to implement :-\ People scripted these in games since forever. Take CS 1.6 for example.
.

FinchDon

  • Sr. Member
  • Posts: 252
Re: Can it be possible
« Reply #5, on September 14th, 2015, 03:06 AM »
Unreal Best For Ideas Can i Get Example?
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Thijn

  • VC:MP Beta Tester
  • Posts: 1,688
Re: Can it be possible
« Reply #6, on September 14th, 2015, 06:47 AM »
Quote from FinchDon on September 14th, 2015, 03:06 AM
Unreal 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.
Code: [Select]
if ( (time() - <lastkilltime killer>) <= 2 ) {

FinchDon

  • Sr. Member
  • Posts: 252
Re: Can it be possible
« Reply #8, on September 14th, 2015, 11:23 AM »
I tried Your Code @Thijn Lol Its Say's Error Expression Expected

Line 921

if ( (time() - <lastkilltime killer>) <= 100 )
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Drake

  • VC:MP Beta Tester
  • Posts: 287

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761

Debian

  • Jr. Member
  • Posts: 62
Re: Can it be possible
« Reply #11, on September 14th, 2015, 12:14 PM »Last edited on September 14th, 2015, 12:26 PM
not tested,
make a lastkill in player class or store value somewhere for a player mostly in array
Code: [Select]

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

MacTavish

  • Hero Member
  • Nicks( Kusanagi, Beztone, RATHORE )
  • Posts: 809
Re: Can it be possible
« Reply #12, on September 14th, 2015, 12:21 PM »
Caution:its an untested idea perhaps it works

Code: [Select]
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
}
}

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

  • Wiki Contributor
  • Posts: 3,343
Re: Can it be possible
« Reply #13, on September 14th, 2015, 06:16 PM »Last edited on September 14th, 2015, 06:34 PM
Hehe, the problem is FinnchDon don't have a simple time function....
Code: [Select]
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
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,807
.