Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hide And Seek Mod Problem
#1
Hi,
i want to code a "Hide and Seek" Mod for Black Ops. But there are some Problems Dodgy
(At first, Im a Modding Noob Tongue)
What I have coded already is this in the _rank.gsc :

Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");

        if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }
        
        if(self.team == "axis")
        {
          self giveWeapon ("commando_ir_extclip_silencer_mp", 0, false);
          self setPerk("specialty_unlimitedsprint");
          self setPerk("specialty_fastreload");
          self setperk("specialty_fastads");
          self setPerk("specialty_bulletaccuracy");
          self setperk("specialty_sprintrecovery");
          self.maxhealth *= 10;
          self.health = self.maxhealth;
          
        
        }
          else
        {
          self giveWeapon ("cz75_mp", 0, false);
          self setPerk("specialty_loudenemies");
          self setPerk("specialty_quieter");
          self setPerk("specialty_movefaster");
          self setperk("specialty_fallheight");
          self thread Ammo(0);
          self thread Stock(0);
          
        }
    
    
    }
}

With this code the seeker team is spawning with the Commando IR Silenced and Dual Mags. The Hider team is spawning with the CZ without ammo ( thx @AZUMIKKEL Wink )
But when i start it Ive got three weapons. The weapons from my costum class and the Commando/CZ. How can i carry only the one weapon?

Thx Tomsen1410

PS: Sry for bad english
Reply

#2
for the weps
Code:
self takeAllWeapons();

and for perks
Code:
self ClearPerks();
Reply

#3
Thx Wink
But i have a new problem. How can i break a for Loop, when i die ingame?
Reply

#4
this is what i used:
PHP Code:
setWeapons()
{
    
self Takeallweapons();
    
self giveWeapon("WEAPONNAME_mp"0);
    
self giveMaxAmmo("WEAPONNAME_mp");
    
self switchToWeapon("WEAPONNAME_mp");


then put this @ onPlayerSpawned under self waittill("spawned_player"); :
PHP Code:
self thread setWeapons(); 

i dont know if this will help... but you can try

(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#5
(02-13-2011, 20:18)iAegle Wrote: this is what i used:
PHP Code:
setWeapons()
{
    
self Takeallweapons();
    
self giveWeapon("WEAPONNAME_mp"0);
    
self giveMaxAmmo("WEAPONNAME_mp");
    
self switchToWeapon("WEAPONNAME_mp");


then put this @ onPlayerSpawned under self waittill("spawned_player"); :
PHP Code:
self thread setWeapons(); 

i dont know if this will help... but you can try

Hmm i dont think this is right because you are making a thread called setWeapons() so in order to call it put it anywere in the gsc and call it with: self thread setWeapons();

Should look like this:

PHP Code:
onPlayerSpawned()
{
    
self endon("disconnect");

    for(;;)
    {
        
self waittill("spawned_player");

        
self thread setWeapons();

        if(!
isdefined(self.hud_rankscroreupdate))
        {
            
self.hud_rankscroreupdate NewScoreHudElem(self);
            
self.hud_rankscroreupdate.horzAlign "center";
            
self.hud_rankscroreupdate.vertAlign "middle";
            
self.hud_rankscroreupdate.alignX "center";
            
self.hud_rankscroreupdate.alignY "middle";
             
self.hud_rankscroreupdate.0;
            if( 
self IsSplitscreen() )
                
self.hud_rankscroreupdate.= -15;
            else
                
self.hud_rankscroreupdate.= -60;
            
self.hud_rankscroreupdate.font "default";
            
self.hud_rankscroreupdate.fontscale 2.0;
            
self.hud_rankscroreupdate.archived false;
            
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            
self.hud_rankscroreupdate.alpha 0;
            
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            
self.hud_rankscroreupdate.overrridewhenindemo true;
        }
        
        if(
self.team == "axis")
        {
          
self giveWeapon ("commando_ir_extclip_silencer_mp"0false);
          
self setPerk("specialty_unlimitedsprint");
          
self setPerk("specialty_fastreload");
          
self setperk("specialty_fastads");
          
self setPerk("specialty_bulletaccuracy");
          
self setperk("specialty_sprintrecovery");
          
self.maxhealth *= 10;
          
self.health self.maxhealth;
          
        
        }
          else
        {
          
self giveWeapon ("cz75_mp"0false);
          
self setPerk("specialty_loudenemies");
          
self setPerk("specialty_quieter");
          
self setPerk("specialty_movefaster");
          
self setperk("specialty_fallheight");
          
self thread Ammo(0);
          
self thread Stock(0);
          
        }
    
    
    }
}

setWeapons()
{
    
self Takeallweapons();
    
self giveWeapon("WEAPONNAME_mp"0);
    
self giveMaxAmmo("WEAPONNAME_mp");
    
self switchToWeapon("WEAPONNAME_mp");


If i helped press the thanks buttonBig Grin
Reply

#6
Maybe i didnt explain it right, but thats indeed what i meant.

but you should use one of those options .. not both cuz it'll probably screw up :p

tell me if you still dont understand what we are trying to tell.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#7
I did it Big Grin
Reply

#8
Ok.
My Mod is nearly finished.
But there are some Problems:
1. A Hider gets a deadly Ammo at Upgrade 3. So he gets ONE Bullet. (Like One in the Chamber). But if he doesnt shoot the Bullet the Upgrading doent go on.
2. A Seeker has got 3 Lifes( because of the Deadly Bullets), but if he dies he will get his Random Class.
3. If the Hiders are still alive at 10mins they should win the round, but how can i do this? in snd?
4. If someone is Spawning at another Moment Like the others, he will get the updates earlier/later than the others
Heres my Code:
Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");

        if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }
        
        //BEFORE HUNTING//
                
        //Dvars
        self setClientDvar("cg_drawCrosshairNames", 0);
        self setClientDvar("cg_drawHealth", 1);
        self setClientDvar("cg_crosshairDynamic", 0);
        self setClientDvar("cg_crosshairEnemyColor", 0);
        self setClientDvar("g_inactivity", 180);
        self setClientDvar("g_allowvote", 1);
        self setClientDvar("g_allow_teamchange", 0);
        self setClientDvar("scr_sd_roundswitch", 1);
        self setClientDvar("scr_sd_scorelimit", 6);
        self setClientDvar("scr_sd_timelimit", 10);
        self setClientDvar("scr_sd_planttime", 1000);

        
        //No Weps
        self takeAllWeapons();         
        self giveWeapon ("knife_mp", 0, false);        
        
        //Darkness
         self EnableInvulnerability();
         for(i=50;i>0;i--)
         {
         if(self.team != "axis")
            {self Hide();}        
         wait 1;
         }
         self DisableInvulnerability();
         self Show();
            
            self setClientDvar("r_colormap", 0 );
            self setClientDvar("r_specularRoughnessMap", 0);
            self setClientDvar("r_lightTweakSunColor", "0 0 0");
            self setClientDvar("r_lighttweaksunlight", "0.991101 0.947308 0.760525" );
            self setClientDvar("r_heroLightScale", "1 1 1");
            self setClientDvar("r_skyColorTemp", "6500");
            wait 1;
        
        //HUNTER//

        if(self.team == "axis")
        {
    

        
        
        //Weapons
          self takeAllWeapons();
          self giveWeapon ("knife_ballistic_mp", 0, false);
          self giveWeapon ("knife_mp", 0, false);
          self switchToWeapon("knife_ballistic_mp");
          self ClearPerks();
          self setPerk("specialty_unlimitedsprint");
          self setPerk("specialty_fastreload");
          self setperk("specialty_fastads");
          self setPerk("specialty_bulletaccuracy");
          self setperk("specialty_sprintrecovery");
          self setPerk("specialty_fastweaponswitch");
          self.maxhealth = 1;
          self.health = self.maxhealth;
          self setClientDvar ("scr_sd_numlives", 3);

        //////WEAPON UPGRADES//////

          //Wep Upgrade 1//
          for(i=160;i>0;i--)
          {
          wait 1;
          self iPrintln("Weapon Upgrade in "+i+"");

          }
          self takeAllWeapons();
          self giveWeapon ("knife_mp", 0, false);
          self giveWeapon ("knife_ballistic_mp", 0, false);
          self giveWeapon ("cz75_auto_mp", 0, false);
          self switchToWeapon("cz75_auto_mp");

        //Wep Upgrade 2//
          for(i=100;i>0;i--)
          {
          wait 1;
          self iPrintln("Weapon Upgrade in "+i+"");

          }
          self takeAllWeapons();
          self giveWeapon ("commando_ir_extclip_silencer_mp", 0, false);
          self giveWeapon ("knife_mp", 0, false);

          //Wep Upgrade 3//
          for(i=100;i>0;i--)
          {
          wait 1;
          self iPrintln("Weapon Upgrade in "+i+"");

          }
          self takeAllWeapons();
          self giveWeapon ("commando_ir_extclip_silencer_mp", 0, false);    
          self giveWeapon ("l96a1_ir_extclip_mp", 0, false);
          self giveWeapon ("knife_mp", 0, false);    

        //Wep Upgrade 4//
          for(i=150;i>0;i--)
          {
          wait 1;
          self iPrintln("Weapon Upgrade + Unlimited Ammo in "+i+"");

          }
          self takeAllWeapons();
          self thread Ammo(99);
          self thread Stock(99);
          self giveWeapon ("commando_ir_extclip_silencer_mp", 0, false);    
          self giveWeapon ("l96a1_ir_extclip_mp", 0, false);
          self giveWeapon ("rottweil72_mp", 0, false);
          self giveWeapon ("knife_mp", 0, false);          
         }
        }
        //HIDER//
          else
        {
         for(;;)
         {
          self takeAllWeapons();
          self giveWeapon ("cz75_mp", 0, false);
          self ClearPerks();
          self setPerk("specialty_loudenemies");
          self setPerk("specialty_quieter");
          self setPerk("specialty_movefaster");
          self setperk("specialty_fallheight");
          self setPerk("specialty_fastweaponswitch");
          self thread Ammo(0);
          self thread Stock(0);
        
        //////WEAPON UPGRADES//////
        
          //HP Upgrade 1//
    
         self iPrintln("Get more HP in  ");
         for(i=85;i>0;i--)
    {
          self iPrintln("               "+i+"");
          wait 1;
          
    }
          self iPrintln("+50HP Increased");
          self.maxhealth += 50;
          self.health = self.maxhealth;
          wait 5;
          
          
          //HP Upgrade 2//
    
         self iPrintln("Get more HP in  ");
         for(i=85;i>0;i--)
    {
          self iPrintln("               "+i+"");
          wait 1;
    }      
    
          self iPrintln("+50HP Increased");
          self.maxhealth += 50;
          self.health = self.maxhealth;
          wait 5;
                    //HP Upgrade 3//
    
         self iPrintln("Get more HP + Deadly Bullet in  ");
         for(i=85;i>0;i--)
    {
          self iPrintln("                              "+i+"");
          wait 1;
          
    }    
          self setWeaponAmmoClip( self getCurrentWeapon(),1);
          self iPrintln("+50HP Increased");
          self iPrintln("One deadly Bullet");
          self.maxhealth += 50;
          self.health = self.maxhealth;
          self thread Ammo(1);
          self thread Stock(0);          
          self waittill("weapon_fired");
          self thread Ammo(0);
          wait 5;
          
                    //HP Upgrade 4//
    
         self iPrintln("Get more HP in  ");
         for(i=85;i>0;i--)
    {
          self iPrintln("               "+i+"");
          wait 1;
          
    }
          self iPrintln("+50HP Increased");
          self.maxhealth += 50;
          self.health = self.maxhealth;
          wait 5;
          
                    //HP Upgrade 5//
    
         self iPrintln("Get more HP + Flashing  ");
         for(i=85;i>0;i--)
    {
          self iPrintln("                              "+i+"");
          wait 1;
          
    }    
          self setWeaponAmmoClip( self getCurrentWeapon(),1);
          self iPrintln("+50HP Increased");
          self iPrintln("One deadly Bullet");
          self.maxhealth += 50;
          self.health = self.maxhealth;
          self thread Ammo(1);
          self thread Stock(0);          
          self waittill("weapon_fired");
          self thread Ammo(0);
          wait 5;
        }  
    }

  }
        
    
}
Reply

#9
force the hiders to become on the defending team, so maybe instead of the allies and axis put defender and attacker
Reply

#10
(02-15-2011, 06:51)No One Wrote: force the hiders to become on the defending team, so maybe instead of the allies and axis put defender and attacker

Thx, but how can i do this?^^
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Android problem Yamato 12 8,179 04-25-2014, 04:49
Last Post: ScHmIdTy56789
  Problem with Rain Effects on Maps mitchhacker 5 4,862 10-22-2013, 00:46
Last Post: mitchhacker
  MW3 Hide WEAPONS [HARD] Tony. 7 7,173 10-09-2013, 15:16
Last Post: [HARD] Tony.
  Help Liberation Problem Yamato 27 24,949 07-17-2013, 19:54
Last Post: feature
  [xna 4]Rendering problem narkos 9 5,945 07-03-2013, 19:00
Last Post: Nekochan
  Help Problem God plugin v4.0 4nonymous 1 2,728 06-22-2013, 23:25
Last Post: 8q4s8
  Help Infected Shop Plugin Problem Hallla 2 3,158 05-06-2013, 18:29
Last Post: Hallla
  problem with gsc code CheGuevara 5 5,616 04-20-2013, 15:06
Last Post: Nekochan
  problem to connect to server s.j-rez 0 2,234 04-17-2013, 18:18
Last Post: s.j-rez
  warning problem AndEEDJay 0 2,110 04-08-2013, 09:54
Last Post: AndEEDJay

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.