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

Members Online

»
0 Active | 65 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: Prone check
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, May. 4, 2007 08:33 pm
does anyone know of a code that checks the player stance?[banghead]
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Saturday, May. 5, 2007 12:07 pm
in SP you can use the function getstance(), so probably in MP too.
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, May. 5, 2007 12:51 pm
could you show me an example of how I would write it?
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Saturday, May. 5, 2007 12:54 pm
trig = getent ("trigger", "targetname");
trig waittill ("trigger", other);
other getstance();

you can also use it in a if loop.. like this

if (other getstance() == "prone")
{
...
}
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, May. 5, 2007 01:21 pm
A bit off topic, on our servers you have to stay crouched, we use a code that checks to see if the player is crouched or running, after a set time if the player is still running he get's a message in his face warning him to stop running and stay crouched, after 3 warnings his gun is disabled for a set number of seconds.
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, May. 5, 2007 01:51 pm
Is your server the 509th? and are you using the awe mod?
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, May. 5, 2007 02:04 pm
No, I'm not with the 509th, but I've been on their servers[wink]

We use the Extreme Mod, your clan name?
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Sunday, May. 6, 2007 01:08 am
ooooh I'm with the 105thSTS we are trying to get this to work with our mod that we are making. We dont want to use the extreme or awe.[crazy]
Share |
TheModDoctor
General Member
Since: Apr 27, 2007
Posts: 174
Last: Jan 10, 2009
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, May. 12, 2007 09:08 am
Is it possible to change the stance when you go through a trigger? Like maybe:

trig = getent("trig_name", "targetname");
trig waittill ("trigger");

What then?
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, May. 12, 2007 10:10 am
Webber, this is what we are using now, but like I said, I'm using the Extreme Mod, but you might be able to do something with it.

Code:

//////////////No Run Added//////////////////
 

runner()
{
 level endon("ex_gameover");
 self endon("disconnect"); 
 self endon("ex_dead");
a = 0; 
 
 for(;;)
 {
 
  position = self getorigin();
        wait 5;
        compareposition = self getorigin();  
ren = distance(position,compareposition);
uuu = self [[level.ex_getstance]](false);
 
//******First Offense****************
if(uuu == 0 && ren > 500 && a==0) self iprintlnBold("^1STOP Running^7  " + self.name + " ^1Or Your Weapon Will Be Disabled!" ); 
if(uuu == 0 && ren > 500) a=a+1; 
 
//********Second Offense**************
if(uuu == 0 && ren > 500 && a==2) self iprintlnBold(self.name + " ^12nd Running Warning, ^7Weapon disabled for ^14 seconds!");
if(uuu == 0 && ren > 500 && a==2) self disableWeapon();
wait 4;
if(uuu == 0 && ren > 500 && a==2) self enableWeapon();
 
//**********Third Offense***************
if(uuu == 0 && ren > 500 && a==3) self iprintlnBold(self.name + " ^1LAST WARNING, ^7You Dropped Your weapon");
if(uuu == 0 && ren > 500 && a==3) self thread extreme\_ex_weapons::dropcurrentweapon();
 
//**********Sixth Offense***************
if(uuu == 0 && ren > 500 && a==4) self iprintlnBold(self.name + " ^1You have been kicked for running! You may rejoin ^7IF^1 you follow server rules!!");
if(uuu == 0 && ren > 500 && a==4) iprintln(self.name + " ^1 has been kicked for constant running!!");
wait 3;
if(uuu == 0 && ren > 500 && a==4) kick(self getEntityNumber());
 

    }
}
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

»