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: Won't giveweapon
Carl21221
General Member
Since: Apr 13, 2006
Posts: 134
Last: Jul 31, 2015
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Wednesday, Apr. 2, 2008 08:18 pm
Hi again guys,
I am trying to take the weapon i have at the beginning of the level and give myself a different one after a set period of time. Here's the script.

Code:
givetakeweapons()
{
	level.player takeallweapons();
	wait(20);
	level.player giveweapon("m1garand");
}


it takes all of my weapons but when it is time to give me the other weapon i get an error stating i do not have an empty weapon slot.

I have tried a couple of other ways, e.g.
Code:
givetakeweapons()
{
	currentweapon = level.player getCurrentWeapon();
	level.player takeweapon(currentweapon);
	wait(20);
	level.player giveweapon("m1garand");
}


and..

Code:
givetakeweapons()
{
 	playerWeapon = level.player getweaponslotweapon("primary");
	level.player takeweapon(playerWeapon);
wait(20);
level.player giveweapon ("m1garand");
}


but those two didn't even take my current gun away.

Any ideas about the error i get?

thanks in advance. [thumbs_up]
Share |
Carl21221
General Member
Since: Apr 13, 2006
Posts: 134
Last: Jul 31, 2015
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Apr. 3, 2008 09:55 pm
bump
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

»