Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: weapon back after killstreak
konrad12345678
General Member
Since: Aug 19, 2011
Posts: 9
Last: Feb 12, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Tuesday, Jan. 3, 2012 02:20 pm
Hi evryone! I have script:

Code:
if(attacker.spree == 10)
	{
		attacker iprintlnbold("^1Killing Spree!");
		attacker playlocalsound("Killing_spree");
		wait 0.2
		iprintln(self.name+" ^7is on Killing spree!");
		attacker setWeaponSlotWeapon("primaryb", "launcher_mp");
		attacker switchToWeapon("launcher_mp");
		attacker givemaxammo(self getweaponslotweapon("primaryb"));
	}


What should I do to get weapons back (primary) after killstreak? I should do new weapon slot? Thanks a lot :D

Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Tuesday, Jan. 3, 2012 08:13 pm
you can use the getcurrentweapon(); func to save your weapon before you switch it. then when your done you can simply use your old weapon again.

Example :
Code:
oldweapon = attacker getcurrentweapon();


then when you want to use your old weapon again.
Code:
attacker setWeaponSlotWeapon("primaryb", oldweapon);
attacker switchToWeapon(oldweapon);


something like that.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Wednesday, Jan. 4, 2012 12:29 am
how about

Code:

if(!isclear(question))
{
     response="Please clarify your question";
}
else
{
     response=something_useful;
}
return response;
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Jan. 4, 2012 10:23 am
Hello konrad12345678,You can use this

Code:
if(attacker.spree == 10)
{
attacker iprintlnbold("^1Killing Spree!");
attacker playlocalsound("Killing_spree");
wait 0.2
iprintln(self.name+" ^7is on Killing spree!");
weapon = attacker getweaponslotweapon("primaryb");
clip=attacker getweaponslotclipammo("primaryb");
ammo=attacker getweaponslotammo("primaryb");
attacker setWeaponSlotWeapon("primaryb", "launcher_mp");
attacker switchToWeapon("launcher_mp");
attacker givemaxammo(attacker getweaponslotweapon("primaryb"));
attacker thread dobriy(weapon,clip,ammo);
}

dobriy(weapon,clip,ammo)
{
while(1)
{
if(self getweaponslotclipammo("primaryb")==0 && self getweaponslotammo("primaryb") ==0 && self getweaponslotweapon("primaryb") == "launcher_mp" )
{
self setWeaponSlotWeapon("primaryb", weapon);
self switchToWeapon(weapon);
self setweaponslotammo("primaryb", ammo);
self setweaponslotclipammo("primaryb", clip);
break;
}
}
}
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Jan. 4, 2012 01:46 pm
konrad, DONT use this script above
dobriy, please.... correct your script!

Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Jan. 4, 2012 07:22 pm
does my reply mean nothing lately? [duh] and Dobriy... that the hell kind of mess is that? i believe i already answered this guy. i didnt just hand him a script but i answered his question already if he needs anymore help he can reply back.
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Jan. 4, 2012 07:37 pm
Don't help this flicker! He stole my script. Its exactly the same as I had on my server. Even killstreak 10 and the launcher_mp
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Jan. 4, 2012 07:50 pm
yeah whats new, get use to it.
Share |
konrad12345678
General Member
Since: Aug 19, 2011
Posts: 9
Last: Feb 12, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Thursday, Jan. 5, 2012 12:32 pm
I stole your script? Are you kidding me? Script not work...
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, Jan. 5, 2012 09:46 pm
It does work, but you fail;)
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»