| Author |
Topic: CoD2 Bubble Problem! |
| nemanja-1997 |
General Member Since: Jan 5, 2012 Posts: 5 Last: Jan 6, 2012 [view latest posts] |
|
|
|
|
| liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
 |
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
|
| nemanja-1997 |
General Member Since: Jan 5, 2012 Posts: 5 Last: Jan 6, 2012 [view latest posts] |
|
|
|
|
| Dobriy |
General Member Since: Mar 31, 2011 Posts: 96 Last: May 23, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Friday, Jan. 6, 2012 04:41 pm |
 |
nemanja-1997
U can use my script
Code: main
{
level._effect["nuk"] = loadfx ("fx/zombie/dbubble_deploy.efx");
level._effect["nuks"] = loadfx ("fx/zombie/dbubble_hit.efx");
level._effect["nu"] = loadfx ("fx/zombie/dbubble_green.efx");
level._effect["s"]= loadfx ("fx/zombie/dbubble_powerdown.efx");
self.hudbuble destroy();
self.hudbuble = newClientHudElem(self);
self.hudbuble.alignx = "center";
self.hudbuble.x = 330;
self.hudbuble.y = 120;
self.hudbuble.fontscale = 1.2;
self.hudbuble.label = &"^2`^9[^1For Delete^9]^2:";
bubble = spawn( "script_model",self.origin+(0,0,20));
bubble setModel("xmodel/bx_dbubble");
time=60;
while(1)
{
time-=0.1;
self.hudbuble setValue(int(time));
bubble rotateto((0, randomfloat(360), randomfloat(360)), 0.4);
playFx( level.fx_dbubble_loop, bubble.origin + (0,0,15));
wait 0.1;
if(time<=0 || self.pers["team"]!="allies" )
{
self.hudbuble destroy();
bubble hide();
playFx( level._effect["s"], bubble.origin );
bubble delete();
self.spawnprotected=false;
break;
}
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if(players[i].pers["team"]=="axis" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
playFx( level._effect["nuks"],players[i].origin+(0,0,15));
players[i].health = players[i].health + 300;
players[i] finishPlayerDamage(players[i], players[i], 300, 0, "MOD_PROJECTILE", "panzerschreck_mp", bubble.origin, vectornormalize(players[i].origin - bubble.origin), "none", 0);
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
players[i].spawnprotected=true;
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) >= 100 && isAlive(players[i]))
{
players[i].spawnprotected=false;
}
}
}
} |
 |
|
|
| nemanja-1997 |
General Member Since: Jan 5, 2012 Posts: 5 Last: Jan 6, 2012 [view latest posts] |
|
|
|
|
| nemanja-1997 |
General Member Since: Jan 5, 2012 Posts: 5 Last: Jan 6, 2012 [view latest posts] |
|
|
|
|
| tHMatt |
 |
General Member Since: Sep 11, 2007 Posts: 473 Last: Mar 20, 2013 [view latest posts] |
|
|
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Saturday, Jan. 7, 2012 12:49 am |
 |
Dobriy writes...Quote: nemanja-1997
U can use my script
Code: main
{
level._effect["nuk"] = loadfx ("fx/zombie/dbubble_deploy.efx");
level._effect["nuks"] = loadfx ("fx/zombie/dbubble_hit.efx");
level._effect["nu"] = loadfx ("fx/zombie/dbubble_green.efx");
level._effect["s"]= loadfx ("fx/zombie/dbubble_powerdown.efx");
self.hudbuble destroy();
self.hudbuble = newClientHudElem(self);
self.hudbuble.alignx = "center";
self.hudbuble.x = 330;
self.hudbuble.y = 120;
self.hudbuble.fontscale = 1.2;
self.hudbuble.label = &"^2`^9[^1For Delete^9]^2:";
bubble = spawn( "script_model",self.origin+(0,0,20));
bubble setModel("xmodel/bx_dbubble");
time=60;
while(1)
{
time-=0.1;
self.hudbuble setValue(int(time));
bubble rotateto((0, randomfloat(360), randomfloat(360)), 0.4);
playFx( level.fx_dbubble_loop, bubble.origin + (0,0,15));
wait 0.1;
if(time<=0 || self.pers["team"]!="allies" )
{
self.hudbuble destroy();
bubble hide();
playFx( level._effect["s"], bubble.origin );
bubble delete();
self.spawnprotected=false;
break;
}
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if(players[i].pers["team"]=="axis" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
playFx( level._effect["nuks"],players[i].origin+(0,0,15));
players[i].health = players[i].health + 300;
players[i] finishPlayerDamage(players[i], players[i], 300, 0, "MOD_PROJECTILE", "panzerschreck_mp", bubble.origin, vectornormalize(players[i].origin - bubble.origin), "none", 0);
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
players[i].spawnprotected=true;
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) >= 100 && isAlive(players[i]))
{
players[i].spawnprotected=false;
}
}
}
}
at least 3 things wrong witht his code: the loadfx() is called too late, so it runs after a wait. Dont ever do this.
The typo: main should be main()
And last but not least: having a while(true) loop which breaks on one condition. Put it in the fkcing loop if you dont mind. thx. |
 |
|
|
| Dobriy |
General Member Since: Mar 31, 2011 Posts: 96 Last: May 23, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Saturday, Jan. 7, 2012 09:45 am |
 |
IzNoGoD writes...Quote: Dobriy writes...Quote: nemanja-1997
U can use my script
Code: main
{
level._effect["nuk"] = loadfx ("fx/zombie/dbubble_deploy.efx");
level._effect["nuks"] = loadfx ("fx/zombie/dbubble_hit.efx");
level._effect["nu"] = loadfx ("fx/zombie/dbubble_green.efx");
level._effect["s"]= loadfx ("fx/zombie/dbubble_powerdown.efx");
self.hudbuble destroy();
self.hudbuble = newClientHudElem(self);
self.hudbuble.alignx = "center";
self.hudbuble.x = 330;
self.hudbuble.y = 120;
self.hudbuble.fontscale = 1.2;
self.hudbuble.label = &"^2`^9[^1For Delete^9]^2:";
bubble = spawn( "script_model",self.origin+(0,0,20));
bubble setModel("xmodel/bx_dbubble");
time=60;
while(1)
{
time-=0.1;
self.hudbuble setValue(int(time));
bubble rotateto((0, randomfloat(360), randomfloat(360)), 0.4);
playFx( level.fx_dbubble_loop, bubble.origin + (0,0,15));
wait 0.1;
if(time<=0 || self.pers["team"]!="allies" )
{
self.hudbuble destroy();
bubble hide();
playFx( level._effect["s"], bubble.origin );
bubble delete();
self.spawnprotected=false;
break;
}
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if(players[i].pers["team"]=="axis" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
playFx( level._effect["nuks"],players[i].origin+(0,0,15));
players[i].health = players[i].health + 300;
players[i] finishPlayerDamage(players[i], players[i], 300, 0, "MOD_PROJECTILE", "panzerschreck_mp", bubble.origin, vectornormalize(players[i].origin - bubble.origin), "none", 0);
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) < 100 && isAlive(players[i]))
{
players[i].spawnprotected=true;
}
if(players[i].pers["team"]=="allies" && distance(bubble.origin, players[i].origin ) >= 100 && isAlive(players[i]))
{
players[i].spawnprotected=false;
}
}
}
}
at least 3 things wrong witht his code: the loadfx() is called too late, so it runs after a wait. Dont ever do this.
The typo: main should be main()
And last but not least: having a while(true) loop which breaks on one condition. Put it in the fkcing loop if you dont mind. thx.
IzNoGoD,You consider yourselves as the cleverest at the given forum? Can before criticising that that is checked really up and works, you show something the instead of will philosophise before those who understands of nothing in cod2 scripting and your advice are not necessary to them, scripts are necessary to them.thx |
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|