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

Members Online

»
0 Active | 78 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 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
Page
Previous Page
subscribe
Author Topic: Weapons to specified ppl (GUID)
LiQ.HeaDShOt
General Member
Since: Jun 1, 2010
Posts: 51
Last: Feb 21, 2011
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Saturday, Aug. 21, 2010 11:38 pm
Xylozi writes...
Quote:
To include a .GSC file in a pre-built mod, you will need to create a server-side IWD. To do so:

1. Download these tools (FF Decompiler): http://modsonline.com/Downloads-full-4786.html
2. Decompile the mod, and find the _globallogic.gsc
3. Find this section of the code:

Code:
	if ( !isDefined( level.tweakablesInitialized ) )
		maps\mp\gametypes\_tweakables::init();


Below it, add this:

Code:
level thread setupWeapons();


4. Now, go to the bottom of the _globallogic.gsc and copy and paste this in:

Code:

setupWeapons()
{
	// To add a new weapon/guid:
	// Copy the last level.sWeapon[level.sWeapons.size] line and change the filename in the " "
	
	level.allowedGUIDs = []
	level.allowedGUIDs[level.allowedGUIDs.size] = "GUIDONE";
	level.allowedGUIDs[level.allowedGUIDs.size] = "GUIDTWO";
	
	level.sWeapon = []
	level.sWeapon[level.sWeapon.size] = "rpd_mp";
	level.sWeapon[level.sWeapon.size] = "m14_mp";
	level.sWeapon[level.sWeapon.size] = "m4_mp";
	
	level thread monitorDvar();
	level thread onPlayerConnect();
}

onPlayerConnect()
{
	for(;;)
	{
		level waittill( "connected", player );
		player thread OnSpawn();
	}
}

OnSpawn()
{
	self endon( "disconnect" );
	
	for(;;)
	{
		self waittill( "spawned" );
		
		self thread checkGUID();
	}
}

checkGUID()
{
	self.isSpecial = false;

	for( i = 0; i < level.allowedGUIDs.size; i++ )
	{
		guid = level.allowedGUIDs[i];
		
		if( ToLower( self GetGUID() ) == ToLower( guid ) )
			self.isSpecial = true;
	}
	
	if( self.isSpecial )
	{
		for( w = 0; w < level.sWeapon.size; w++ )
		{
			self giveWeapon( level.sWeapon[w] );
			self giveMaxAmmo( level.sWeapon[w] );
		}
	}
}

monitorDvar()
{
	setDvar( "scr_giveWeapon", "" );
	
	while(1)
	{
		if( getDvar( "scr_giveWeapon" ) != "" )
			thread giveWeapon();
			
		wait 0.05;
	}
}

giveWeapon()
{
	// When typing in the command, do /rcon scr_giveWeapon PLAYERID WEAPONNAME
	string = strTok( getDvar( "scr_giveWeapon" ), " " );
	setDvar( "scr_giveWeapon", "" );
	
	if( !isDefined( string[0] ) ||!isDefined( string[1] ) )
		return;
	
	players = getEntArray( "player", "classname" );
	for( i = 0; i < players.size; i++ )
	{
		player = players[i];
	
		if( player getEntityNumber() == int( string[0] ) )
		{	
			player giveWeapon( string[1] );
			player giveMaxAmmo( string[1] );
		}
	}
}


5. Save the _globallogic.gsc.
6. Go to your mod folder (the one you wish to edit) and make these folders, in one another:

Code:
maps -> mp -> gametypes


6. Go in the gametypes folder, and copy and paste your _globallogic.gsc in.

To create the IWD, you need to do:

1. Install a compression program, e.g. 7zip
2. Right click on the maps folder and click Add to Archive
3. Click the .zip radio button
4. Name the file: z_svr_weapons.iwd and click Ok.

You now have your script 'installed' in a server-side IWD, which must be uploaded to your server (but NOT your redirect), in the mod folder your using.


I understood it but it seems that the Decompiler isn't helping me.
In fact, when I drag and drop the mod.ff, the decompiler creates a file *.dump but, when I search the globallogic, i cant find it.. neither the globallogic nor the:

Code:

 if ( !isDefined( level.tweakablesInitialized ) )
		maps\mp\gametypes\_tweakables::init();


Since I can't complete those steps, I can't continue...
Plz help.. Rly want to make this ;P

LiQ.HeaDShOt
Share |
LiQ.HeaDShOt
General Member
Since: Jun 1, 2010
Posts: 51
Last: Feb 21, 2011
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Monday, Aug. 30, 2010 05:55 pm
Help?
Rly need this!

Plz...
:S
Share |
LiQ.HeaDShOt
General Member
Since: Jun 1, 2010
Posts: 51
Last: Feb 21, 2011
[view latest posts]
Level 3
Category: CoD4 Scripting
Posted: Wednesday, Sep. 8, 2010 11:25 pm
Help plz..
Tried with other mod.ff(s) and found globallogic but couldnt find in my mod.ff

What should I do?
(Btw, i would prefer to recompile it and add this script)

Thanks,
LiQ.HeaDShOt
Share |
Restricted Access Topic is Locked
Page
Previous Page
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

»