Posts: 1,185
Threads: 72
Joined: Jan 2011
Reputation:
25
02-13-2011, 15:10
(This post was last modified: 02-14-2011, 23:09 by Tomsen1410.)
Hi,
i want to code a "Hide and Seek" Mod for Black Ops. But there are some Problems
(At first, Im a Modding Noob )
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 )
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
Posts: 46
Threads: 10
Joined: Jan 2011
Reputation:
3
for the weps
Code: self takeAllWeapons();
and for perks
Posts: 1,185
Threads: 72
Joined: Jan 2011
Reputation:
25
Thx
But i have a new problem. How can i break a for Loop, when i die ingame?
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
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
Posts: 539
Threads: 39
Joined: Dec 2010
Reputation:
49
(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.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); } } }
setWeapons() { self Takeallweapons(); self giveWeapon("WEAPONNAME_mp", 0); self giveMaxAmmo("WEAPONNAME_mp"); self switchToWeapon("WEAPONNAME_mp"); }
If i helped press the thanks button
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
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.
Posts: 1,185
Threads: 72
Joined: Jan 2011
Reputation:
25
I did it
Posts: 1,185
Threads: 72
Joined: Jan 2011
Reputation:
25
02-14-2011, 22:06
(This post was last modified: 02-14-2011, 23:21 by Tomsen1410.)
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;
}
}
}
}
Posts: 379
Threads: 37
Joined: Dec 2010
Reputation:
6
02-15-2011, 06:51
(This post was last modified: 02-15-2011, 06:56 by No One.)
force the hiders to become on the defending team, so maybe instead of the allies and axis put defender and attacker
Posts: 1,185
Threads: 72
Joined: Jan 2011
Reputation:
25
(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?^^
|