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

Members Online

»
0 Active | 61 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: b3 command (!nade)
Reactionzzz
General Member
Since: Apr 11, 2011
Posts: 1
Last: Apr 11, 2011
[view latest posts]
Level 0
Category: CoD2 Scripting
Posted: Monday, Apr. 11, 2011 07:43 am
I'm making a command to nade a person and they have like 5 seconds to run.

Code:
_b3_nade()

{


     B3PlayerNum = getDvarint("b3_nade");
	 setDvar("b3_nade", "");
	 
	 players = getentarray("player", "classname");
	 for(i = 0; i < player.size; i++)
	 {
	     player = players[i];
		 
	thisPlayerNum = getEntityNumber();
	     if(thisPlayerNum = B3PlayerNum)
         {
		     player thread _cmd_nade();
	     }
	}
}

This is _cmd_nade_threaded.
Code:
_cmd_nade_threaded()
{
     {    
    if (self.pers["team"] != "spectator")
    {
        if(isAlive(self))
        {                           

can't finish off this second script. oO
Share |
r00t_
General Member
Since: Dec 15, 2010
Posts: 51
Last: May 16, 2011
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, May. 4, 2011 04:51 pm
try:
Code:
_cmd_nade_threaded()
{
    if (self.pers["team"] != "spectator")
    {
        if(isAlive(self))
        {
              start = self.origin;
              wait(5);
              //so they need to get away from the nade in 5 sec?
              //if so, make them run away, and find the distance
              //and if the distance is suitably far enough away
              //don't kill them. Something like this:
              end = self.origin;
              //then i forget how to get distance but it looks
              //something like this: (again not entirely sure...)
              dist = distance(start, end)
              if(dist > 5 || isAlive(self) == false)
                    return;
              else
                    self.suicide;
        }
    }
}

And you really are going to need to check on some of those functions, because i haven't been on these forums in awhile and haven't scripted in awhile so i don't honestly remember most of the functions...but there's an idea for how you could do it. Best of luck
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

»