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

Members Online

»
0 Active | 112 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: Need help with my ammo purchase system
Zachary75
General Member
Since: May 22, 2012
Posts: 5
Last: Jun 21, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Wednesday, Jun. 20, 2012 07:35 pm
I need help with something. I need to make it so that you can purchase ammo, but i don't know to write the script so that the game will accept any amount of money from 200-6000.
Code:
resupply()
{
    resupplytrig = getent("resupply", "targetname")
	while(1)
	{
	    resupplytrig waittill("trigger", player);
	    
		if(money == 200-6000);
		    continue;
		
		takemoney 200
		ammo = level.player getweaponslotammo("primary");
		ammo = level.player getweaponslotammo("primaryb");
	}
}


Please help.
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Jun. 20, 2012 08:02 pm
Code:
if(money == 200-6000);// lololol


why is it you need to find between 200 and 6,000? just wondering. and you just do.

Code:
if(money >= 200 && money <= 6000)


what that is doing is saying, if money is 200 or greater and less then or = to 6,000 then continue;
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Wednesday, Jun. 20, 2012 09:16 pm
Zachary75 writes...
Quote:

Code:
	if(money == 200-6000);
		    continue; //lolol you even know what continue; does?
		
		takemoney 200 //lolol calling a function and lolol on who?
		ammo = level.player getweaponslotammo("primary"); //lolol who you calling this on?
		ammo = level.player getweaponslotammo("primaryb"); //lolol see previous comment
	}
}



I can see this is mostly your very first script.
Try to read some tutorials and try to understand some scripts others made.
Share |
Zachary75
General Member
Since: May 22, 2012
Posts: 5
Last: Jun 21, 2012
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Thursday, Jun. 21, 2012 08:32 pm
I can't find any tutorials or information on MP scripting like this. I know who to call function on in SP scripting but not in MP.
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Thursday, Jun. 21, 2012 08:51 pm
you can download hundred of cod mods + all source scripts of cod1 cod:uo cod2 cod4 cod5 cod6 cod7 cod8
app. 1000000 billion lines of pure source code... so try yourself to do something...
also there are around 10 tutorials on how to start with codescript here, on modsrepository and when i google it, i'll findalot of stuff in the very first page...
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

»