malyczolg
1st April 2013, 11:38
who can add delete turret ?
if i add :
self._sentry delete();
self._sentryasd delete();
self._sentryhead delete();
Turret is invisible and kill enemy.
script :
init()
{
precachemodel("xmodel/prop_barrel_black_wet");
precachemodel("xmodel/superweap_worldmodel");
precachemodel("xmodel/military_flak88_tube");
level.effects["large_bark"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["large_brick"]=loadfx("fx/impacts/large_brick.efx");
level.effects["large_carpet"]=loadfx("fx/impacts/default_hit.efx");
level.effects["large_cloth"]=loadfx("fx/impacts/cloth_hit.efx");
level.effects["large_concrete"]=loadfx("fx/impacts/large_plaster.efx");
level.effects["large_dirt"]=loadfx("fx/impacts/large_dirt.efx");
level.effects["large_flesh"]=loadfx("fx/impacts/flesh_hit.efx");
level.effects["large_foliage"]=loadfx("fx/impacts/small_foliage.efx");
level.effects["large_glass"]=loadfx("fx/impacts/large_glass.efx");
level.effects["large_grass"]=loadfx("fx/impacts/small_grass.efx");
level.effects["large_gravel"]=loadfx("fx/impacts/large_gravel.efx");
level.effects["large_ice"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["large_metal"]=loadfx("fx/impacts/large_metalhit.efx");
level.effects["large_mud"]=loadfx("fx/impacts/large_mud.efx");
level.effects["large_paper"]=loadfx("fx/impacts/default_hit.efx");
level.effects["large_plaster"]=loadfx("fx/impacts/large_plaster.efx");
level.effects["large_rock"]=loadfx("fx/impacts/large_rock.efx");
level.effects["large_sand"]=loadfx("fx/impacts/large_dirt.efx");
level.effects["large_snow"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["large_water"]=loadfx("fx/impacts/large_waterhit.efx");
level.effects["large_wood"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["large_asphalt"]=loadfx("fx/impacts/large_rock.efx");
level.effects["large_default"]=loadfx("fx/impacts/default_hit.efx");
level.effects["small_bark"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["small_brick"]=loadfx("fx/impacts/small_brick.efx");
level.effects["small_carpet"]=loadfx("fx/impacts/default_hit.efx");
level.effects["small_cloth"]=loadfx("fx/impacts/cloth_hit.efx");
level.effects["small_concrete"]=loadfx("fx/impacts/small_concrete.efx");
level.effects["small_dirt"]=loadfx("fx/impacts/small_dirt.efx");
level.effects["small_flesh"]=loadfx("fx/impacts/flesh_hit.efx");
level.effects["small_foliage"]=loadfx("fx/impacts/small_foliage.efx");
level.effects["small_glass"]=loadfx("fx/impacts/small_glass.efx");
level.effects["small_grass"]=loadfx("fx/impacts/small_grass.efx");
level.effects["small_gravel"]=loadfx("fx/impacts/small_gravel.efx");
level.effects["small_ice"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["small_metal"]=loadfx("fx/impacts/small_metalhit.efx");
level.effects["small_mud"]=loadfx("fx/impacts/small_mud.efx");
level.effects["small_paper"]=loadfx("fx/impacts/default_hit.efx");
level.effects["small_plaster"]=loadfx("fx/impacts/small_concrete.efx");
level.effects["small_rock"]=loadfx("fx/impacts/small_rock.efx");
level.effects["small_sand"]=loadfx("fx/impacts/small_dirt.efx");
level.effects["small_snow"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["small_water"]=loadfx("fx/impacts/small_waterhit.efx");
level.effects["small_wood"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["small_asphalt"]=loadfx("fx/impacts/small_concrete.efx");
level.effects["small_default"]=loadfx("fx/impacts/default_hit.efx");
}
sentrygun()
{
//start = self._sentry.origin;
//players=getentarray("player","classname");
//for(i=0;i<players.size;i++)
//end = player.origin;
self endon("disconnect");
vec=anglestoforward(self getplayerangles());
self._sentry = spawn( "script_model", self.origin );
self._sentry setModel("xmodel/prop_barrel_black_wet");
self._sentry.angles = self.angles;
self._sentryasd=spawn("script_model", self.origin + (0,0,30));
self._sentryasd setModel("xmodel/military_flak88_tube");
target = self.origin;
self._sentryhead=spawn("script_model", self.origin + (0,0,50));
self._sentryhead setModel("xmodel/superweap_worldmodel");
self._sentryhead rotateyaw(5100,40);
self._sentrysound = spawn("script_origin",self._sentry.origin);
self iprintln("^9TUR^9RET ^3~> ^910^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^99^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^98^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^97^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^96^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^95^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^94^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^93^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^92^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^91^7Sec ^9Le^7ft");
wait 1;
self._sentry delete();
self._sentryasd delete();
self._sentryhead delete();
for(;;)
{
players=getentarray("player","classname");
for(i=0;i<players.size;i++)
{
player = players[i];
trace = bulletTrace(self._sentryhead.origin, player.origin + (0,0,50), false, self._sentryhead);
if(isAlive(player) && distance(player.origin,self._sentryhead.origin) > 1 && trace["fraction"] == 1)
{
if ((isDefined(player.spawnprotected) && player.spawnprotected == 0) && (player.pers["team"] != self.pers["team"]))
{
self._sentryhead.angles = vectortoangles(player.origin - self._sentryhead.origin);
player finishPlayerDamage(player, self, 15, 1, "MOD_EXPLOSIVE", "tesla_mp", (0,0,0), (0,0,0), "none",0);
self._sentrysound playSoundAtLocation("turrettesla", target, 0 );
break;
}
}
self._sentryhead rotateyaw(5100,40);
}
wait 0.2;
}
}
PlaySoundAtLocation(sound, location, iTime)
{
org = spawn("script_model", location);
wait 0.05;
org show();
org playSound(sound);
wait iTime;
org delete();
return;
}
if i add :
self._sentry delete();
self._sentryasd delete();
self._sentryhead delete();
Turret is invisible and kill enemy.
script :
init()
{
precachemodel("xmodel/prop_barrel_black_wet");
precachemodel("xmodel/superweap_worldmodel");
precachemodel("xmodel/military_flak88_tube");
level.effects["large_bark"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["large_brick"]=loadfx("fx/impacts/large_brick.efx");
level.effects["large_carpet"]=loadfx("fx/impacts/default_hit.efx");
level.effects["large_cloth"]=loadfx("fx/impacts/cloth_hit.efx");
level.effects["large_concrete"]=loadfx("fx/impacts/large_plaster.efx");
level.effects["large_dirt"]=loadfx("fx/impacts/large_dirt.efx");
level.effects["large_flesh"]=loadfx("fx/impacts/flesh_hit.efx");
level.effects["large_foliage"]=loadfx("fx/impacts/small_foliage.efx");
level.effects["large_glass"]=loadfx("fx/impacts/large_glass.efx");
level.effects["large_grass"]=loadfx("fx/impacts/small_grass.efx");
level.effects["large_gravel"]=loadfx("fx/impacts/large_gravel.efx");
level.effects["large_ice"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["large_metal"]=loadfx("fx/impacts/large_metalhit.efx");
level.effects["large_mud"]=loadfx("fx/impacts/large_mud.efx");
level.effects["large_paper"]=loadfx("fx/impacts/default_hit.efx");
level.effects["large_plaster"]=loadfx("fx/impacts/large_plaster.efx");
level.effects["large_rock"]=loadfx("fx/impacts/large_rock.efx");
level.effects["large_sand"]=loadfx("fx/impacts/large_dirt.efx");
level.effects["large_snow"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["large_water"]=loadfx("fx/impacts/large_waterhit.efx");
level.effects["large_wood"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["large_asphalt"]=loadfx("fx/impacts/large_rock.efx");
level.effects["large_default"]=loadfx("fx/impacts/default_hit.efx");
level.effects["small_bark"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["small_brick"]=loadfx("fx/impacts/small_brick.efx");
level.effects["small_carpet"]=loadfx("fx/impacts/default_hit.efx");
level.effects["small_cloth"]=loadfx("fx/impacts/cloth_hit.efx");
level.effects["small_concrete"]=loadfx("fx/impacts/small_concrete.efx");
level.effects["small_dirt"]=loadfx("fx/impacts/small_dirt.efx");
level.effects["small_flesh"]=loadfx("fx/impacts/flesh_hit.efx");
level.effects["small_foliage"]=loadfx("fx/impacts/small_foliage.efx");
level.effects["small_glass"]=loadfx("fx/impacts/small_glass.efx");
level.effects["small_grass"]=loadfx("fx/impacts/small_grass.efx");
level.effects["small_gravel"]=loadfx("fx/impacts/small_gravel.efx");
level.effects["small_ice"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["small_metal"]=loadfx("fx/impacts/small_metalhit.efx");
level.effects["small_mud"]=loadfx("fx/impacts/small_mud.efx");
level.effects["small_paper"]=loadfx("fx/impacts/default_hit.efx");
level.effects["small_plaster"]=loadfx("fx/impacts/small_concrete.efx");
level.effects["small_rock"]=loadfx("fx/impacts/small_rock.efx");
level.effects["small_sand"]=loadfx("fx/impacts/small_dirt.efx");
level.effects["small_snow"]=loadfx("fx/impacts/small_snowhit.efx");
level.effects["small_water"]=loadfx("fx/impacts/small_waterhit.efx");
level.effects["small_wood"]=loadfx("fx/impacts/large_woodhit.efx");
level.effects["small_asphalt"]=loadfx("fx/impacts/small_concrete.efx");
level.effects["small_default"]=loadfx("fx/impacts/default_hit.efx");
}
sentrygun()
{
//start = self._sentry.origin;
//players=getentarray("player","classname");
//for(i=0;i<players.size;i++)
//end = player.origin;
self endon("disconnect");
vec=anglestoforward(self getplayerangles());
self._sentry = spawn( "script_model", self.origin );
self._sentry setModel("xmodel/prop_barrel_black_wet");
self._sentry.angles = self.angles;
self._sentryasd=spawn("script_model", self.origin + (0,0,30));
self._sentryasd setModel("xmodel/military_flak88_tube");
target = self.origin;
self._sentryhead=spawn("script_model", self.origin + (0,0,50));
self._sentryhead setModel("xmodel/superweap_worldmodel");
self._sentryhead rotateyaw(5100,40);
self._sentrysound = spawn("script_origin",self._sentry.origin);
self iprintln("^9TUR^9RET ^3~> ^910^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^99^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^98^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^97^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^96^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^95^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^94^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^93^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^92^7Sec ^9Le^7ft");
wait 1;
self iprintln("^9TUR^9RET ^3~> ^91^7Sec ^9Le^7ft");
wait 1;
self._sentry delete();
self._sentryasd delete();
self._sentryhead delete();
for(;;)
{
players=getentarray("player","classname");
for(i=0;i<players.size;i++)
{
player = players[i];
trace = bulletTrace(self._sentryhead.origin, player.origin + (0,0,50), false, self._sentryhead);
if(isAlive(player) && distance(player.origin,self._sentryhead.origin) > 1 && trace["fraction"] == 1)
{
if ((isDefined(player.spawnprotected) && player.spawnprotected == 0) && (player.pers["team"] != self.pers["team"]))
{
self._sentryhead.angles = vectortoangles(player.origin - self._sentryhead.origin);
player finishPlayerDamage(player, self, 15, 1, "MOD_EXPLOSIVE", "tesla_mp", (0,0,0), (0,0,0), "none",0);
self._sentrysound playSoundAtLocation("turrettesla", target, 0 );
break;
}
}
self._sentryhead rotateyaw(5100,40);
}
wait 0.2;
}
}
PlaySoundAtLocation(sound, location, iTime)
{
org = spawn("script_model", location);
wait 0.05;
org show();
org playSound(sound);
wait iTime;
org delete();
return;
}