Posts: 916
Threads: 65
Joined: Jun 2011
06-30-2011, 21:18
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?
Posts: 916
Threads: 65
Joined: Jun 2011
07-25-2011, 14:12
(This post was last modified: 07-25-2011, 17:10 by Scripts18.)
(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
Posts: 916
Threads: 65
Joined: Jun 2011
09-17-2011, 13:13
(This post was last modified: 09-17-2011, 13:14 by Scripts18.)
(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
Noobie
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)