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

Members Online

»
0 Active | 8 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 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
Page
Previous Page Next Page
subscribe
Author Topic: guide through first steps of modding
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: Thursday, Feb. 17, 2011 04:50 am
keep a loop checking for the badnames and to kick someone you just do kick(self); you need to ofc define who self is but yeah.
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: Saturday, Feb. 19, 2011 06:18 pm
hey guys
i made a new quickmessage menu, it works really nice :)
it isnt that tricky i ever though of lol
but hell, its si9mple text on screen nothing more
the difficulties will come xD
maybe u can help me with some problems?
1. (see script posted last time) i cant loop this script, with while(1) and for(;;) server hard laggs, without u can change ur name into a badname after connecting
2. belongs to quickcommand admin menu
is it possible to get specific player for kick/ban whatever? i me without creating 64 menu-files for every slotnumber (like execkey 6 waitwill execkey 4 ) or is it better to create several menu-files?
but it is messy when u have 64 for kick 64 for ban 64 for teleport 64 for burn ... and so on
maybe u can give me some advice how to manage this (try to do it on my own)
thanks guys :o
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Feb. 19, 2011 07:43 pm
Code:

renamer_init()
{

	level.wrongname[0] = "UnnamedPlayer";
	level.wrongname[1] = "Unknown Soldier";
	level.wrongname[2] = "Killer";
	level.wrongname[3] = "Motherfucker";
	level.wrongname[4] = "flick";
	level.wrongname[5] = "flicker";
	level.wrongname[6] = "CONSLE";
	level.wrongname[7] = "Sex";
	level.wrongname[8] = "Fist";
	level.wrongname[9] = "Anal";
	level.wrongname[10] = "cancer";
	level.wrongname[11] = "moron";
	level.wrongname[12] = "gay";
	level.badname[0] = "Nazi";
	level.badname[1] = "Hitler";
	level.badname[2] = "Goering";
	level.badname[3] = "Adolf";
	level.badname[4] = "Himmler";
	level.badname[5] = "Nigga";
	level.badname[6] = "african american";
	level.badname[7] = "Sieg heil";
	level.badname[8] = "Heil";
	level.badname[9] = "Sieg";
	level.badname[10] = "Rommel";
	level.badname[11] = "Jew";
	level.badname[12] = "Racist";
	level.badname[13] = "Stalin";
	level.badname[14] = "Heil hitler";
	thread waitforplayer();
}

waitforplayer()
{
	for(;;)
	{
		level waittill("connecting",player);
		player thread onconnect();
	}
}

onconnect()
{
	self endon("disconnect");
	for(;;)
	{
		oldname=self.name;
		if(isinarray(self.name,level.wrongname))
		{
			self setclientcvar("name","Played on ^1|^2G^1r^2Z^1|17 " + randomint(999));
			self iprintlnbold("You got renamed to ^7"+self.name+"\n^7Please choose a better name next time");
		}
		else if(isinarray(self.name,level.badname))
		{
			self setclientcvar("name","My brain doesnt work " + randomint(999));
			self iprintlnbold("You got renamed to ^7"+self.name+"\n^7Please choose a better name next time");
		}
		while(self.name==oldname)
			wait 1;
		wait 0.05;
	}
}

isinarray(var,array)
{
	for(i=0;i<array.size;i++)
	{
		if(array[i]==var)
			return true;
	}
	return false;
}


please read some more tutorials.
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: Sunday, Feb. 20, 2011 12:43 am
ohh looks sweet iznogod
its hard to understand for me with the variables in the functions
especially waittills notifies endons and so on
ill google now what isinarray fct is, looks good [thumbs_up]

ur patience is reached soon, right ^^ idont want annoy you, sorry guys

edit:
isinarray got 2 values in it
u use them somewhere and u have to define themlater
if they return true, the function keep going, if not it breaks, right?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, Feb. 20, 2011 08:44 am
the isinarray(var,array) is a function i wrote myself. It should be at the bottom of the script (is it not?)

It checks the whole array, and sees if that particular array entry is the same as the var you are checking it against.

If it matches, it will return a "true". If "return" is used, the isinarray function will stop.

If no matches are found, it continues with the isinarray function, which returns a false then.
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: Sunday, Apr. 24, 2011 09:08 pm
hey

1 tiny question

does something like
test["timelimit"] work instead of game["timelimit"] ?

cause i tried it and i failed ._.

Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Sunday, Apr. 24, 2011 09:45 pm
You might first have to make the "test" var into an array by using:

test=[];
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: Monday, Apr. 25, 2011 10:28 am
thank you for reply
i tried this before and i recieved an error, but now i know it should be my fault
and one more question
what program do you use?
i prefer the normal windows notepad, its kind of 'clean' for me i like it
i tested notepad++ but i cannot scroll in it
and programmers notepad, but there i had to setup the configurations (like show numbers etc.) everytime

but both other programs arent bad, they can be really helpfull
maybe i start learn to use them
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Monday, Apr. 25, 2011 12:22 pm
Hehe, I wrote my whole "modern mod" in notepad. It rocks!

If you guys wanna try that mod, just add me to xfire: imbackagainiba.
If you dont already have me in xfire, you have never seen such a mod before, i promise!
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: Monday, Apr. 25, 2011 02:37 pm
i think you should get into notepad++. i was the same way always writing my mods in regular notepad. then Robinson told me about notepad++ and iv been hooked to it sense. its very clean and very easy to spot an error. id recommend it to anyone modding.
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
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

»