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

Members Online

»
0 Active | 4 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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Setting to spawn without any weapons, is it possible?
bNasty
General Member
Since: Feb 26, 2008
Posts: 94
Last: Feb 18, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Tuesday, Feb. 17, 2009 07:57 am
Does anyone know of a way to setup a server / mod to spawns without any weapons?

Trying out an idea but need players to startout without weapons.
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Tuesday, Feb. 17, 2009 08:44 am
Have a look at _class.gsc in raw/maps/mp/gametypes.

In particular the giveLoadout() function. Have a look for anywhere the giveweapon function is used. If you comment out / remove those lines then you won't be given a weapon.

Make sure you have a backup of the raw file before you start editing!
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Feb. 17, 2009 08:46 am
TakeAllWeapons();

Here


you could call it in maps/mp/gametypes/_globallogic::spawnplayer();

and put 'self takeallweapons();' near the bottom.


edited on Feb. 17, 2009 03:48 am by INSANE{H|S}
Share |
bNasty
General Member
Since: Feb 26, 2008
Posts: 94
Last: Feb 18, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Tuesday, Feb. 17, 2009 03:41 pm
Am I correct in assuming that after I do one of these suggestions I will need to build it as a mod to get these into the game?
Share |
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoD4 Scripting
Posted: Tuesday, Feb. 17, 2009 04:52 pm
Put the following line into yourmapname.gsc or nazi_zombie_yourmapname.gsc:
TakeAllWeapons();
And it will automaticly go into your maps ff file(s)!
Putting it on the wrong place could deliver an error!
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD4 Scripting
Posted: Tuesday, Feb. 17, 2009 05:51 pm
That won't necessarily work Scillman as it doesn't know who to take the weapon from.

you could try adding something like this to your map .gsc - otherwise you're looking at a mod.

Code:
onPlayerConnect()
{
   for(;;) 
   {
      level waittill("connected",player); // detects a player connection
         player thread takeWeaponsOnSpawn(); // runs the function below
   }
}<br />
<br />
takeWeaponsOnSpawn()
{
   self endon("disconnect"); // loop only ends when the player leaves the server
   
   for(;;)
   {
      self waittill("spawned_player"); // waits until the player spawns
         self takeAllWeapons(); // takes their weapons
   }
}


You'll need to thread onPlayerConnect from your main function.

eg.
Code:
level thread onPlayerConnect();


Share |
bNasty
General Member
Since: Feb 26, 2008
Posts: 94
Last: Feb 18, 2009
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Wednesday, Feb. 18, 2009 05:56 am
Thanks Pedro that worked perfect.

Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»