Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Weapon Change after certain Number of kills
#1
Sad 
I need help to make a certain weapon change after kill for example 5 times with it to another weapon

also I need to be able to select wich weapon change to wich weapon, how many kills is needed

Any one can help me plz? Sad
Reply

#2
Code:
giveWeaponForStreak( weapon, streak )
{
    self endon( "death" );
    self endon( "disconnect" );
    
    for( i = 0 ; i < int(streak); i++ )
        self waittill( "killed_player" );
        
    self takeWeapon( self getCurrentWeapon() );
    self giveWeapon( weapon );
    self switchToWeapon( weapon );
}

use it like this
Code:
self giveWeaponForStreak( "ak47_mp", 5 );

It restarts on death ... so its like a killstreak
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
(06-30-2011, 21:30)iAegle Wrote:
Code:
giveWeaponForStreak( weapon, streak )
{
    self endon( "death" );
    self endon( "disconnect" );
    
    for( i = 0 ; i < int(streak); i++ )
        self waittill( "killed_player" );
        
    self takeWeapon( self getCurrentWeapon() );
    self giveWeapon( weapon );
    self switchToWeapon( weapon );
}

use it like this
Code:
self giveWeaponForStreak( "ak47_mp", 5 );

It restarts on death ... so its like a killstreak

I dont really get how this works, it says by me "wrong syntax'', where does it needs to be placed, can you plz give an example
Reply

#4
(07-25-2011, 12:23)Kipiop Wrote:
(06-30-2011, 21:30)iAegle Wrote:
Code:
giveWeaponForStreak( weapon, streak )
{
    self endon( "death" );
    self endon( "disconnect" );
    
    for( i = 0 ; i < int(streak); i++ )
        self waittill( "killed_player" );
        
    self takeWeapon( self getCurrentWeapon() );
    self giveWeapon( weapon );
    self switchToWeapon( weapon );
}

use it like this
Code:
self giveWeaponForStreak( "ak47_mp", 5 );

It restarts on death ... so its like a killstreak

I dont really get how this works, it says by me "wrong syntax'', where does it needs to be placed, can you plz give an example

It might work , or theres bad syntax, I recommend learning a bit gsc files before doing this
Reply

#5
Hello everyone,

After deployed your code I got this error:
"Server script compile error uninitialized variable 'streak'"
...any idea what went wrong?

many thanks

NoobieBig Grin
Reply

#6
(09-17-2011, 08:41)Alpha_One Wrote: Hello everyone,

After deployed your code I got this error:
"Server script compile error uninitialized variable 'streak'"
...any idea what went wrong?

many thanks

NoobieBig Grin

giveWeaponForStreak( weapon, streak )

Dont modify that line ^^^

self giveWeaponForStreak( "ak47_mp", 5 );

That line you must have one (you can change the weapon name and number of kills needed too)
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 2,783 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,079 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,396 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,804 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 7,632 08-06-2013, 06:28
Last Post: 14th
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,444 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Mw3 Feed Color Change?? aluzion 5 5,448 07-16-2013, 19:52
Last Post: barata
  Help Mw2 weapon skin question FroxIVx4 1 2,713 07-06-2013, 19:22
Last Post: surtek
  Change death animation Keouf 3 3,695 07-05-2013, 18:39
Last Post: Nekochan
Question Help change single file lzma maker to multiple in c# raminr63 1 2,752 05-12-2013, 19:31
Last Post: raminr63

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.