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

Members Online

»
0 Active | 7 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
Page
Next Page
subscribe
Author Topic: Weapon but no ammo
sggassasin1996
General Member
Since: May 13, 2009
Posts: 32
Last: Sep 22, 2009
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 06:34 am
hey could someone tell me to make it so when a player spawns that they have no weapon or ammo or just no ammo


and also could someone plz tell me how to make it so that i can change the team names when they joine to ..

Death

and

Runners


and if you have the spear time could someone help me make it so that i can put someones name into a txt file or something and then allowes them to run fast


if any one could help me with any of these that would be grate thx.

Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 09:30 am
sp or mp?

takeallweapons() removes all weapons

disableweapons should work too for what you want to do

itemweaponsetammo is one of the functions to set the ammo amount
Share |
sggassasin1996
General Member
Since: May 13, 2009
Posts: 32
Last: Sep 22, 2009
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 09:36 am
mp
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 09:38 am
Sevenz writes...
Quote:
sp or mp?

takeallweapons() removes all weapons

disableweapons should work too for what you want to do

itemweaponsetammo is one of the functions to set the ammo amount


Be careful with the use of itemweaponsetammo() as it can only be called by the weapon itself - if you use it with a player, it will return an error.

for players, you use setWeaponAmmoClip( weaponname, amount ).
Share |
sggassasin1996
General Member
Since: May 13, 2009
Posts: 32
Last: Sep 22, 2009
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 09:50 am
could you also tell me how to add it to a script coz im new to scripting and i just whant this to get done so if you help that would be great
Share |
sggassasin1996
General Member
Since: May 13, 2009
Posts: 32
Last: Sep 22, 2009
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 09:50 am
Somehow this was added on idk y

edited on Sep. 21, 2009 05:51 am by sggassasin1996
Share |
sggassasin1996
General Member
Since: May 13, 2009
Posts: 32
Last: Sep 22, 2009
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 09:50 am
could you also tell me how to add it to a script coz im new to scripting and i just whant this to get done so if you help that would be great
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 11:30 am
do you want to disable weapons only on a certain map, on all maps or only for certain gametypes?
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Monday, Sep. 21, 2009 11:40 am
sggassasin1996 writes...
Quote:
could you also tell me how to add it to a script coz im new to scripting and i just whant this to get done so if you help that would be great


Well, I dont have the script you are intending to use, but this is a self-contained script which, when run from a mod at Callback_StartGametype(), will remove a players ammo on spawn:

Code:

init()
{
	thread onPlayerConnect();
}

onPlayerConnect()
{
	level endon ( "game_ended" );
	
	for( ;; )
	{
		level waittill("connecting", player);
		
		player thread onPlayerSpawned();
	}
}

onPlayerSpawned()
{
	self endon("disconnect");
	
	for( ;; )
	{
		self waittill("spawned_player");
		
		wait 0.05;
		
		current = self getCurrentWeapon();
		self setWeaponAmmoStock( current, 0 );
		self setWeaponAmmoClip( current, 0 );
	}
}
Share |
sggassasin1996
General Member
Since: May 13, 2009
Posts: 32
Last: Sep 22, 2009
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Sep. 22, 2009 12:31 am
thank you deamon seed



So dose anyone know how to change the names of the team?
Share |
Restricted Access Topic is Locked
Page
Next 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

»