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

Members Online

»
0 Active | 82 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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: Starting weapons in SP
Cypher2004
General Member
Since: Jul 24, 2004
Posts: 312
Last: Feb 17, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, Aug. 10, 2006 12:47 pm
Ok. I have added the following script to try and get some starting weapons in my SP map:

Code:
level.player takeallweapons();
level.player giveWeapon("m1garand");
level.player giveWeapon("thompson");
level.player giveWeapon("fraggrenade");
level.player switchToWeapon("m1garand");


(That isn't my full code, I have a script for an opening screen (the black one with white writing).This is just the section regarding weapons.)

first of all, when the map loads, there is a Lee Enfield rifle in my hands, then it switches to a Garand, but there are no other weapons I can select or grenades.

Also, is it possible to alter the amount of ammo the player has?

Any help will be greatly appreciated.

Cypher[thumbs_up]
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Thursday, Aug. 10, 2006 03:54 pm
Check out the _loadout.gsc file for how to give players weapons..

I think you have to do it by adding this line:

level.player switchToOffhand("fraggrenade");

level.player giveWeapon("m1garand");
level.player giveWeapon("thompson");
level.player giveWeapon("fraggrenade");

level.player switchToWeapon("m1garand");
level.player switchToOffhand("fraggrenade");

This way you should be able to switch between the Garand and the thompson.
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

»