├── vscriptthings ├── eventlistener.nut ├── dynamicsun.nut ├── smart_light.nut ├── jetpack.nut ├── ammo.nut ├── rotater.nut ├── turret.nut ├── pickups.nut ├── healing.nut ├── logic_random_weapon.nut ├── weapon_machine.nut ├── supply_drops.nut ├── rofl_floating_chair_script.nut ├── koth_king.nut └── control_points.nut ├── powerupcollectors ├── README ├── powerups │ ├── leecher.nut │ ├── speed.nut │ ├── regen.nut │ ├── explosiverounds.nut │ └── base.nut └── init.nut ├── dev ├── player_speedmod.nut ├── point_hurt.nut ├── client_command.nut ├── io.nut ├── player_events.nut ├── centerprint.nut ├── instructor_hint.nut ├── game_ui.nut ├── util.nut ├── weaponstage.nut ├── give_weapons.nut └── eventlistener.nut ├── hidden ├── class │ ├── None.nut │ ├── Marine.nut │ ├── Sniper.nut │ ├── Engineer.nut │ ├── Medic.nut │ ├── Demoman.nut │ ├── ClassChooser.nut │ └── Hidden.nut ├── init.nut └── player_class.nut └── zombiesurvival └── init.nut /vscriptthings/eventlistener.nut: -------------------------------------------------------------------------------- 1 | IncludeScript("VUtil.nut") -------------------------------------------------------------------------------- /powerupcollectors/README: -------------------------------------------------------------------------------- 1 | That gamemode in WIP not scraped :# -------------------------------------------------------------------------------- /dev/player_speedmod.nut: -------------------------------------------------------------------------------- 1 | 2 | ::player_speedmod <- Entities.CreateByClassname("player_speedmod"); 3 | 4 | 5 | ::ModifySpeed<-function(player,speed){ 6 | DoEntFire("!self","ModifySpeed",speed.tostring(),0,player,player_speedmod); 7 | } -------------------------------------------------------------------------------- /vscriptthings/dynamicsun.nut: -------------------------------------------------------------------------------- 1 | environment<-EntityGroup[1]; 2 | time<--1; 3 | function Think(){ 4 | time=cos(Time()/12) 5 | environment.__KeyValueFromFloat("pitch",time*160) 6 | environment.__KeyValueFromString("_light","255 "+max(time*255,0)+" "+max(time*255,0)+" "+max(time*255,0)) 7 | environment.__KeyValueFromString("_ambient","255 "+max(time*255,0)+" "+max(time*255,0)+" "+max(time*255,0)) 8 | } -------------------------------------------------------------------------------- /vscriptthings/smart_light.nut: -------------------------------------------------------------------------------- 1 | function Think(){ 2 | ent<-null; 3 | while(ent=Entities.FindByClassname(ent,"light")){ 4 | bright<-false; 5 | ply<-null; 6 | while(ply=Entities.FindByClassnameWithin(ply,"player",ent.GetOrigin(), 600.0)){ 7 | bright=true; 8 | } 9 | if (bright){ 10 | DoEntFire("!self", "TurnOn", "", 0, null, ent); 11 | } else { 12 | DoEntFire("!self", "TurnOff", "", 0, null, ent); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /dev/point_hurt.nut: -------------------------------------------------------------------------------- 1 | 2 | ::point_hurt <- Entities.CreateByClassname("point_hurt"); 3 | 4 | 5 | ::TakeDamage<-function(entity,damage,type){ 6 | local newname=UniqueString("hurtme") 7 | local prevname=entity.GetName() 8 | EntFireByHandle(entity,"addoutput","targetname "+newname,0.0,null,null); 9 | point_hurt.__KeyValueFromString("DamageTarget",newname); 10 | point_hurt.__KeyValueFromFloat("Damage",damage); 11 | point_hurt.__KeyValueFromInt("DamageType",type); 12 | DoEntFire("!self","Hurt","",0,null,point_hurt); 13 | EntFireByHandle(entity,"addoutput","targetname "+prevname,0.0,null,null); 14 | } -------------------------------------------------------------------------------- /dev/client_command.nut: -------------------------------------------------------------------------------- 1 | //Can excute about 0.5% percent command on client. 2 | 3 | ::point_clientcommand <- Entities.CreateByClassname("point_clientcommand"); 4 | 5 | ::SendCommandToClient<-function(player,command){ 6 | DoEntFire("!self","Command",command,0,player,point_clientcommand); 7 | } 8 | 9 | ::DrawRadar<-function(player){ 10 | SendCommandToClient(player,"drawradar") 11 | } 12 | 13 | ::ShowRadar<-DrawRadar 14 | 15 | ::HideRadar<-function(player){ 16 | SendCommandToClient(player,"hideradar") 17 | } 18 | 19 | ::EmitGameSoundOnClient<-function(player,sound){ 20 | SendCommandToClient(player,"playgamesound "+sound) 21 | } 22 | 23 | ::EmitSoundOnClient<-function(player,sound){ 24 | SendCommandToClient(player,"play "+sound) 25 | } -------------------------------------------------------------------------------- /vscriptthings/jetpack.nut: -------------------------------------------------------------------------------- 1 | m_activator<-null; 2 | logic_script<-EntityGroup[1]; 3 | m_activator_jumped<-false; 4 | function Think(){ 5 | if (m_activator){ 6 | vel<-m_activator.GetVelocity() 7 | if (vel.z<0){ 8 | vel<-Vector(vel.x,vel.y,vel.z*0.75) 9 | m_activator.SetVelocity(vel) 10 | } 11 | if (vel.z>0&&!m_activator_jumped){ 12 | vel<-Vector(vel.x,vel.y,vel.z*2.0) 13 | m_activator.SetVelocity(vel) 14 | } 15 | if (vel.z<=0){ 16 | m_activator_jumped<-false 17 | }else{ 18 | m_activator_jumped<-true 19 | } 20 | } 21 | } 22 | function GiveJetpackNearPlayer(){ 23 | m_activator<-Entities.FindByClassnameNearest("player",logic_script.GetOrigin(),100.0) 24 | if (m_activator==null){ 25 | m_activator<-Entities.FindByClassnameNearest("bot",logic_script.GetOrigin(),100.0) 26 | } 27 | } -------------------------------------------------------------------------------- /dev/io.nut: -------------------------------------------------------------------------------- 1 | //============================================// 2 | //Part of VUtil.Logic 3 | //============================================// 4 | 5 | //Links two entities together with the given input & output 6 | function Link(entity,output,target,input = "use",param = "",delay = 0,max = -1) 7 | { 8 | //addoutput format: addoutput " , , , , " 9 | local kvString = format("%s %s,%s,%s,%f,%d",output,target.GetName(),input,param,delay,max); 10 | EntFireByHandle(entity,"addoutput",kvString,0.0,null,null); 11 | } 12 | 13 | function LinkFunction(entity,output,target,func,delay = 0,max = -1) 14 | { 15 | Link(entity,output,target,"callscriptfunction",func,delay,max);//Add an output that calls the function. 16 | } -------------------------------------------------------------------------------- /hidden/class/None.nut: -------------------------------------------------------------------------------- 1 | Classes.None<-{} 2 | 3 | Classes.None.MoveSpeed<-1.0 4 | Classes.None.MaxHealth<-100 5 | Classes.None.Locked<-true 6 | Classes.None.Name<-"None" 7 | 8 | Classes.None.Events<-{} 9 | 10 | Classes.None.Events.OnRespawned<-function(player){} 11 | Classes.None.Events.OnInit<-function(player){} 12 | Classes.None.Events.OnHurt <- function(player,damage){}; 13 | Classes.None.Events.OnHealed <- function(player,amount){}; 14 | Classes.None.Events.OnDie <- function(player,killer){}; 15 | Classes.None.Events.OnKill <- function(player,victim){}; 16 | Classes.None.Events.OnDuck <- function(player){}; 17 | Classes.None.Events.OnUnDuck <- function(player){}; 18 | Classes.None.Events.OnJump <- function(player){}; 19 | Classes.None.Events.OnUpdate <- function(player){}; 20 | Classes.None.Events.OnButton <- function(player,button,bool){}; -------------------------------------------------------------------------------- /dev/player_events.nut: -------------------------------------------------------------------------------- 1 | 2 | ::attacker<-null; 3 | ::victim<-null; 4 | 5 | 6 | ::player_kill<-Entities.CreateByClassname("trigger_brush"); 7 | EntFireByHandle(player_kill,"addoutput","targetname game_playerkill",0.0,null,null); 8 | ::player_kill.ValidateScriptScope() 9 | 10 | local scope=::player_kill.GetScriptScope() 11 | 12 | scope.OnUse <- function(){ 13 | ::attacker=activator 14 | 15 | if (victim!=null&&attacker!=null){ 16 | ::OnPlayerDeath(attacker,victim) 17 | attacker=null; 18 | victim=null; 19 | } 20 | 21 | } 22 | 23 | ::player_kill.ConnectOutput("OnUse","OnUse") 24 | 25 | ::player_die<-Entities.CreateByClassname("trigger_brush"); 26 | EntFireByHandle(player_die,"addoutput","targetname game_playerdie",0.0,null,null); 27 | ::player_die.ValidateScriptScope() 28 | 29 | local scope=::player_die.GetScriptScope() 30 | 31 | scope.OnUse <- function(){ 32 | ::victim=activator 33 | 34 | if (victim!=null&&attacker!=null){ 35 | ::OnPlayerDeath(attacker,victim) 36 | attacker=null; 37 | victim=null; 38 | } 39 | 40 | } 41 | 42 | ::player_die.ConnectOutput("OnUse","OnUse") -------------------------------------------------------------------------------- /hidden/class/Marine.nut: -------------------------------------------------------------------------------- 1 | Classes.Marine<-{} 2 | 3 | Classes.Marine.Locked<-false 4 | Classes.Marine.Name<-"Marine" 5 | Classes.Marine.Description<-"Marine is generic heavy armoured class\nEquipment:M4A1,FiveSeven,Knife" 6 | Classes.Marine.MoveSpeed<-0.75; 7 | Classes.Marine.MaxHealth<-200; 8 | Classes.Marine.Weapons<-["weapon_knife","weapon_fiveseven","weapon_m4a1"]; 9 | Classes.Marine.Events<-{} 10 | 11 | Classes.Marine.Events.OnRespawned<-function(player){ 12 | StripWeapons(player.Ent) 13 | GiveWeapons(player.Ent,Classes.Marine.Weapons) 14 | ModifySpeed(player.Ent,Classes.Marine.MoveSpeed) 15 | player.Ent.SetMaxHealth(Classes.Marine.MaxHealth) 16 | player.Ent.SetHealth(Classes.Marine.MaxHealth) 17 | } 18 | Classes.Marine.Events.OnInit <- function(player){ 19 | player.GetClassTable().Events.OnRespawned(player) 20 | }; 21 | 22 | Classes.Marine.Events.OnHurt <- function(player,damage){}; 23 | Classes.Marine.Events.OnHealed <- function(player,amount){}; 24 | Classes.Marine.Events.OnDie <- function(player,killer){}; 25 | Classes.Marine.Events.OnKill <- function(player,victim){}; 26 | Classes.Marine.Events.OnDuck <- function(player){}; 27 | Classes.Marine.Events.OnUnDuck <- function(player){}; 28 | Classes.Marine.Events.OnJump <- function(player){}; 29 | Classes.Marine.Events.OnUpdate <- function(player){}; 30 | Classes.Marine.Events.OnButton <- function(player,button,bool){}; -------------------------------------------------------------------------------- /dev/centerprint.nut: -------------------------------------------------------------------------------- 1 | 2 | ::env_hudhint<-Entities.CreateByClassname("env_hudhint") 3 | 4 | ::CenterPrint<-function(player,text){ 5 | env_hudhint.__KeyValueFromString("message",text) 6 | EntFireByHandle(env_hudhint,"ShowHudHint","",0.0,player,null) 7 | } 8 | ::CenterHide<-function(player){ 9 | EntFireByHandle(env_hudhint,"HideHudHint","",0.0,player,null) 10 | } 11 | ::CenterPrintFormat<-function(player,text,size,color){ 12 | CenterPrint(player,""+text+"") 13 | } 14 | 15 | //■□ 16 | 17 | ::DrawProgressBar<-function(width,height,progress,color,size){ 18 | local string="" 19 | 20 | for (y<-0;y" 30 | return string 31 | } 32 | 33 | ::CenterPrintTeam<-function(team,text){ 34 | env_hudhint.__KeyValueFromString("message",text) 35 | player <- null; 36 | while((player = Entities.FindByClassname(player,"player")) != null){ 37 | if (team==player.GetTeam()){ 38 | EntFireByHandle(env_hudhint,"ShowHudHint","",0.0,player,null) 39 | } 40 | } 41 | } 42 | 43 | ::CenterPrintAll<-function(text){ 44 | env_hudhint.__KeyValueFromString("message",text) 45 | EntFireByHandle(env_hudhint,"ShowHudHint","",0.0,null,null) 46 | } -------------------------------------------------------------------------------- /hidden/class/Sniper.nut: -------------------------------------------------------------------------------- 1 | Classes.Sniper<-{} 2 | 3 | Classes.Sniper.Locked<-false 4 | Classes.Sniper.Name<-"Sniper" 5 | Classes.Sniper.Description<-"Sniper is high damage unit\nEquipment:Scar20,TEC9,Knife" 6 | Classes.Sniper.MoveSpeed<-0.90; 7 | Classes.Sniper.MaxHealth<-150; 8 | Classes.Sniper.Weapons<-["weapon_knife","weapon_tec9","weapon_scar20"]; 9 | Classes.Sniper.Events<-{} 10 | 11 | Classes.Sniper.Events.OnRespawned<-function(player){ 12 | StripWeapons(player.Ent); 13 | GiveWeapons(player.Ent,Classes.Sniper.Weapons); 14 | ModifySpeed(player.Ent,Classes.Sniper.MoveSpeed) 15 | ModifySpeed(player.Ent,Classes.Sniper.MoveSpeed) 16 | player.Ent.SetMaxHealth(Classes.Sniper.MaxHealth) 17 | player.Ent.SetHealth(Classes.Sniper.MaxHealth) 18 | } 19 | Classes.Sniper.Events.OnInit <- function(player){ 20 | this.OnRespawned(player) 21 | }; 22 | 23 | Classes.Sniper.Events.OnHurt <- function(player,damage){}; 24 | Classes.Sniper.Events.OnHealed <- function(player,amount){}; 25 | Classes.Sniper.Events.OnDie <- function(player,killer){}; 26 | Classes.Sniper.Events.OnKill <- function(player,victim){}; 27 | Classes.Sniper.Events.OnDuck <- function(player){}; 28 | Classes.Sniper.Events.OnUnDuck <- function(player){}; 29 | Classes.Sniper.Events.OnJump <- function(player){}; 30 | Classes.Sniper.Events.OnUpdate <- function(player){}; 31 | Classes.Sniper.Events.OnButton <- function(player,button,bool){}; -------------------------------------------------------------------------------- /vscriptthings/ammo.nut: -------------------------------------------------------------------------------- 1 | DoIncludeScript("dev/instructor_hint.nut",null) 2 | DoIncludeScript("dev/give_weapons.nut",null) 3 | 4 | m_ammoleft<-0; 5 | ammo_activator<-null; 6 | supply<-EntityGroup[1]; 7 | next_refilling<-0; 8 | oldpos<-Vector(0,0,0); 9 | 10 | Think <- function(){ 11 | if (m_ammoleft>0&&next_refilling=i){ 18 | text<-text+"|" 19 | }else{ 20 | text<-text+" " 21 | } 22 | } 23 | text<-"["+text+"]" 24 | ShowInstructorMessage(ammo_activator,"ammo_refill","Refilling "+text,"ammo_9mm",Vector(m_ammoleft*2.5,255-(m_ammoleft*2.5),0),1.0) 25 | if(Distance2D(ammo_activator.GetOrigin(),oldpos)>120){ 26 | next_refilling=Time()+20; 27 | ammo_activator=null; 28 | m_ammoleft=0; 29 | } 30 | } 31 | if (m_ammoleft==0&&ammo_activator!=null){ 32 | next_refilling=Time()+20; 33 | ammo_activator.PrecacheSoundScript("player/ammo_pack_use.wav"); 34 | ammo_activator.EmitSound("player/ammo_pack_use.wav"); 35 | RefreshAmmo(ammo_activator) 36 | ammo_activator=null; 37 | } 38 | } 39 | 40 | StartRefill <- function(){ 41 | if (next_refilling=ply.GetMaxHealth()){ 9 | LastHP[ply.entindex()]<-ply.GetHealth(); 10 | } 11 | if (ply.GetHealth()0&&next_healing=i){ 24 | text<-text+"|" 25 | }else{ 26 | text<-text+" " 27 | } 28 | } 29 | text<-"["+text+"]" 30 | ShowInstructorMessage(heal_activator,"healthy","Healing "+text,"icon_tip",Vector(m_healingleft*2.5,255-(m_healingleft*2.5),0),1.0) 31 | //ShowInstructorMessage(heal_activator,"healthy","Healing "+(100-m_healingleft)+" procent.","icon_tip",Vector(m_healingleft*2.5,255-(m_healingleft*2.5),0),1.0) 32 | if (Distance2D(heal_activator.GetOrigin(),oldpos)>120){ 33 | next_healing=Time()+20; 34 | heal_activator=null; 35 | m_healingleft=0; 36 | } 37 | } 38 | if (m_healingleft==0&&heal_activator!=null){ 39 | heal_activator.SetHealth(heal_activator.GetMaxHealth()); 40 | randint<-RandomInt(1,3).tostring(); 41 | heal_activator.PrecacheSoundScript("physics/cardboard/cardboard_box_strain"+randint+".wav"); 42 | heal_activator.EmitSound("physics/cardboard/cardboard_box_strain"+randint+".wav"); 43 | next_healing=Time()+20; 44 | heal_activator=null; 45 | } 46 | } 47 | 48 | StartHealing <- function(){ 49 | if (next_healing=activator.GetMaxHealth()){ 55 | ShowInstructorMessage(activator,"healthy","You don't need healing now.","icon_tip",Vector(0,255,0),4.0) 56 | } else { 57 | heal_activator=activator; 58 | oldpos<-activator.GetOrigin(); 59 | m_healingleft=100; 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /powerupcollectors/powerups/explosiverounds.nut: -------------------------------------------------------------------------------- 1 | POWERUP = class extends PC.GetPowerupClass("Base") { 2 | Name="Explosive rounds" 3 | Spawnable=true 4 | ModelName="models/props/coop_cementplant/coop_ammo_stash/coop_ammo_stash_full.mdl" 5 | GlowType=PC.GLOWTYPE_OUTLINE 6 | DamageLeft=300 7 | GlowColor=Vector(128,128,128) 8 | 9 | function Precache(){ 10 | PC.PrecacheSoundScript("items/ammopickup.wav"); 11 | PC.PrecacheSoundScript("BaseGrenade.Explode"); 12 | PC.GetPowerupClass("Base").Precache(); 13 | } 14 | 15 | function OnOwnerDeath(ply,_,_,_,_,_,_,_,_,_){ 16 | if (ply!=Owner){return} 17 | VUtil.Event.Remove("player_hurt",Entity) 18 | VUtil.Event.Remove("player_death",Entity) 19 | Remove(); 20 | } 21 | 22 | function OnOwnerHurt(ply,attacker,_,_,weapon,dmg_health,dmg_armor,_){ 23 | if (attacker!=Owner||weapon=="hegrenade"){return} 24 | local damage=VUtil.Math.Max(0,(dmg_health+dmg_armor*2)*0.5) 25 | if (damage>0){ 26 | DamageLeft-=damage 27 | VUtil.Timer.Simple(0.5,"OnTimer",this,[ply,attacker,damage]) 28 | } else { 29 | VUtil.Event.Remove("player_hurt",Entity) 30 | VUtil.Event.Remove("player_death",Entity) 31 | Remove(); 32 | } 33 | } 34 | 35 | function OnTimer(ply,attacker,damage){ 36 | OnExplosiveRound(ply,attacker,damage) 37 | } 38 | 39 | function OnExplosiveRound(ply,attacker,damage){ 40 | foreach (player in VUtil.Entity.GetAllInSphere(ply.GetCenter(),300)){ 41 | if (player.GetClassname()=="player"&&player.GetTeam()!=attacker.GetTeam()){ 42 | VUtil.Entity.TakeDamage(player,damage,attacker,"weapon_hegrenade",VUtil.Constants.DamageTypes.BLAST) 43 | } 44 | } 45 | ply.EmitSound("BaseGrenade.Explode") 46 | DispatchParticleEffect("explosion_hegrenade_interior",ply.GetCenter(),Vector(0,0,0)) 47 | } 48 | 49 | function Think(){ 50 | PC.GetPowerupClass("Base").Think() 51 | if (Model!=null){ 52 | DispatchParticleEffect("weapon_sensorgren_spark_02",Model.GetCenter(),Vector(0,0,0)) 53 | } 54 | } 55 | 56 | function Pickup(player){ 57 | PC.GetPowerupClass("Base").Pickup(player); 58 | Owner.EmitSound("items/ammopickup.wav"); 59 | VUtil.Event.Add("player_hurt",Entity,"OnOwnerHurt",this); 60 | VUtil.Event.Add("player_death",Entity,"OnOwnerDeath",this) 61 | } 62 | } -------------------------------------------------------------------------------- /dev/instructor_hint.nut: -------------------------------------------------------------------------------- 1 | 2 | ::instructor_hint <- Entities.CreateByClassname("env_instructor_hint"); 3 | 4 | ShowInstructorMessage<-function(client,name,message,icon,color,time){ 5 | newname<-"" 6 | prevname<-"" 7 | if (client!=null){ 8 | newname=UniqueString("instructor") 9 | prevname=client.GetName() 10 | EntFireByHandle(client,"addoutput","targetname "+newname,0.0,null,null); 11 | } 12 | instructor_hint.__KeyValueFromInt("hint_static",1); 13 | instructor_hint.__KeyValueFromString("hint_replace_key",name); 14 | instructor_hint.__KeyValueFromString("hint_activator_caption",message); 15 | instructor_hint.__KeyValueFromString("hint_icon_offscreen",icon); 16 | instructor_hint.__KeyValueFromString("hint_icon_onscreen",icon); 17 | instructor_hint.__KeyValueFromVector("hint_color",color); 18 | instructor_hint.__KeyValueFromFloat("hint_timeout",time); 19 | DoEntFire("!self","ShowHint",newname,0,null,instructor_hint); 20 | if (client!=null){ 21 | EntFireByHandle(client,"addoutput","targetname "+prevname,0.0,null,null); 22 | } 23 | } 24 | ShowInstructorMessageEntity<-function(entity,client,name,message,icon,color,time,range){ 25 | newname<-"" 26 | prevname<-"" 27 | if (client!=null){ 28 | newname=UniqueString("instructor") 29 | prevname=client.GetName() 30 | EntFireByHandle(client,"addoutput","targetname "+newname,0.0,null,null); 31 | } 32 | instructor_hint.__KeyValueFromInt("hint_static",0); 33 | instructor_hint.__KeyValueFromString("hint_target",entity.GetName()); 34 | instructor_hint.__KeyValueFromString("hint_replace_key",name); 35 | instructor_hint.__KeyValueFromString("hint_activator_caption",message); 36 | instructor_hint.__KeyValueFromString("hint_icon_offscreen",icon); 37 | instructor_hint.__KeyValueFromString("hint_icon_onscreen",icon); 38 | instructor_hint.__KeyValueFromVector("hint_color",color); 39 | instructor_hint.__KeyValueFromFloat("hint_timeout",time); 40 | instructor_hint.__KeyValueFromFloat("hint_range",range); 41 | DoEntFire("!self","ShowHint",newname,0,null,instructor_hint); 42 | if (client!=null){ 43 | EntFireByHandle(client,"addoutput","targetname "+prevname,0.0,null,null); 44 | } 45 | } 46 | ::HideInstructorMessage<-function(name){ 47 | instructor_hint.__KeyValueFromString("hint_replace_key",name); 48 | DoEntFire("!self","EndHint","",0,null,instructor_hint); 49 | } 50 | -------------------------------------------------------------------------------- /powerupcollectors/powerups/base.nut: -------------------------------------------------------------------------------- 1 | POWERUP = class { 2 | Name="Base" 3 | Spawnable=false 4 | Owner=null 5 | ID=-1 6 | Entity=null //Main entity 7 | Model=null //Before pickup representation 8 | ModelName="" 9 | SpawnPoint=null 10 | CreateModel=true 11 | OffsetVector=Vector(0,0,35) 12 | OffsetAngle=Vector(0,0,0) 13 | GlowEnabled=true 14 | GlowColor=Vector(255,255,255) 15 | GlowType=PC.GLOWTYPE_OUTLINE_PULSE 16 | 17 | function Precache(){ 18 | if (ModelName!=""&&CreateModel){ 19 | PC.PrecacheModel(ModelName) 20 | } 21 | } 22 | 23 | constructor(id,origin,spawnpoint){SpawnPoint=spawnpoint;Initialize(id,origin)} 24 | 25 | function Initialize(id,origin){ 26 | if (SpawnPoint){ 27 | local ss=SpawnPoint.GetScriptScope() 28 | ss.Occupied=true; 29 | } 30 | Entity=VUtil.Entity.Create("info_target") 31 | VUtil.Entity.GiveUniqueName(Entity) 32 | Entity.SetOrigin(origin) 33 | if (CreateModel){ 34 | Model=VUtil.Entity.Create("prop_dynamic_glow",{spawnflags=0,glowcolor=GlowColor,glowstyle=GlowType,glowdist=-1}) 35 | Model.SetModel(ModelName) 36 | Model.SetOrigin(origin+OffsetVector) 37 | Model.SetAngles(OffsetAngle.x,OffsetAngle.y,OffsetAngle.z) 38 | if (GlowEnabled){ 39 | EntFireByHandle(Model,"SetGlowEnabled","",0.0,null,null) 40 | } 41 | EntFireByHandle(Model,"SetParent",Entity.GetName(),0.0,null,null) 42 | } 43 | ID=id 44 | } 45 | 46 | function GetOrigin(){ 47 | return Entity.GetOrigin() 48 | } 49 | 50 | function Pickup(player){ 51 | if (SpawnPoint){ 52 | local ss=SpawnPoint.GetScriptScope() 53 | ss.Occupied=false; 54 | } 55 | SpawnPoint=null 56 | Model.Destroy() 57 | Model=null 58 | Owner=player 59 | Owner.ValidateScriptScope() 60 | Owner.GetScriptScope().Powerups[Name]<-true 61 | } 62 | 63 | function Remove(){ 64 | Owner.GetScriptScope().Powerups[Name]<-null 65 | if (Entity!=null){ 66 | Entity.Destroy() 67 | } 68 | delete PC.Powerups_instances[ID] 69 | } 70 | function Think(){ 71 | if (Entity==null){Remove();return} 72 | if (Model!=null){ 73 | local angle=(Model.GetAngles()+Vector(0,5,0)) 74 | Model.SetAngles(angle.x,angle.y,angle.z) 75 | local player=Entities.FindByClassnameNearest("player",Entity.GetOrigin(),50) 76 | if (player){ 77 | local ss=player.GetScriptScope() 78 | if (!(Name in ss.Powerups&&ss.Powerups[Name])){ 79 | Pickup(player) 80 | return 81 | } 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /hidden/class/Engineer.nut: -------------------------------------------------------------------------------- 1 | Classes.Engineer<-{} 2 | 3 | Classes.Engineer.Locked<-false 4 | Classes.Engineer.Name<-"Engineer" 5 | Classes.Engineer.Description<-"Engineer is class that scan for Hidden by using TA Grenade\nEquipment:Nova,Knife,TA Grenade(SPECIAL)" 6 | Classes.Engineer.MoveSpeed<-1.00; 7 | Classes.Engineer.MaxHealth<-125; 8 | Classes.Engineer.ClassDeployable<-"weapon_tagrenade"; 9 | Classes.Engineer.RechargeTime <- 7.5; 10 | Classes.Engineer.Weapons<-["weapon_knife","weapon_nova"]; 11 | 12 | Classes.Engineer.Events<-{} 13 | 14 | Classes.Engineer.Events.OnRespawned<-function(player){ 15 | StripWeapons(player.Ent) 16 | GiveWeapons(player.Ent,Classes.Engineer.Weapons) 17 | ModifySpeed(player.Ent,Classes.Engineer.MoveSpeed) 18 | player.Ent.SetMaxHealth(Classes.Engineer.MaxHealth) 19 | player.Ent.SetHealth(Classes.Engineer.MaxHealth) 20 | } 21 | Classes.Engineer.Events.OnInit <- function(player){ 22 | player.Data.LastTime <- 0.0; 23 | }; 24 | 25 | Classes.Engineer.CheckSpecialWeapon <- function(player){return HaveWeapon(player.Ent,this.ClassDeployable)} 26 | 27 | function round(value, decimalPoints) { 28 | local f = pow(10, decimalPoints) * 1.0; 29 | local newValue = value * f; 30 | newValue = floor(newValue + 0.5); 31 | newValue = (newValue * 1.0) / f; 32 | return newValue; 33 | } 34 | 35 | function GetActiveTAGrenades(player){ 36 | local tagrenade=null 37 | local array={} 38 | local i=0 39 | while((tagrenade = Entities.FindByClassname(tagrenade,"tagrenade_projectile")) != null){ 40 | if (tagrenade.GetOwner()==player.Ent){ 41 | array[i]<-tagrenade 42 | i++ 43 | } 44 | } 45 | return array 46 | } 47 | 48 | 49 | Classes.Engineer.Events.OnHurt <- function(player,damage){}; 50 | Classes.Engineer.Events.OnHealed <- function(player,amount){}; 51 | Classes.Engineer.Events.OnDie <- function(player,killer){}; 52 | Classes.Engineer.Events.OnKill <- function(player,victim){}; 53 | Classes.Engineer.Events.OnDuck <- function(player){}; 54 | Classes.Engineer.Events.OnUnDuck <- function(player){}; 55 | Classes.Engineer.Events.OnJump <- function(player){}; 56 | Classes.Engineer.Events.OnUpdate <- function(player){ 57 | foreach (k,v in GetActiveTAGrenades(player)){ 58 | local enemy=null 59 | while((enemy = Entities.FindByClassnameWithin(enemy,"player",v.GetOrigin(),512)) != null){ 60 | if (enemy.GetTeam()!=player.Ent.GetTeam()){ 61 | (PlayerManager.FindByHandle(enemy)).Data.TemporaryAlpha+=13 62 | } 63 | } 64 | } 65 | if (!Classes.Engineer.CheckSpecialWeapon(player)){ 66 | if (player.Data.LastTime==0) { 67 | player.Data.LastTime=Time()+Classes.Engineer.RechargeTime 68 | } 69 | player.CenterPrint("TA Grenade "+(100-round((player.Data.LastTime-Time())/Classes.Engineer.RechargeTime*100,0))+"%\n"+DrawProgressBar(25,1,1.0-(player.Data.LastTime-Time())/Classes.Engineer.RechargeTime,"FFFFFF",24)) 70 | if (player.Data.LastTimeREADY") 73 | } 74 | } else { 75 | player.Data.LastTime<-0; 76 | } 77 | } 78 | Classes.Engineer.Events.OnButton <- function(player,button,bool){}; -------------------------------------------------------------------------------- /vscriptthings/logic_random_weapon.nut: -------------------------------------------------------------------------------- 1 | DoIncludeScript("dev/give_weapons.nut",null) 2 | 3 | weapons_models <- [ 4 | "w_eq_decoy_dropped", 5 | "w_eq_flashbang_dropped", 6 | "w_eq_fraggrenade_dropped", 7 | "w_eq_incendiarygrenade_dropped", 8 | "w_eq_molotov_dropped", 9 | "w_eq_smokegrenade_dropped", 10 | "w_eq_taser", 11 | "w_mach_m249_dropped", 12 | "w_mach_negev_dropped", 13 | "w_pist_deagle_dropped", 14 | "w_pist_elite_dropped", 15 | "w_pist_fiveseven_dropped", 16 | "w_pist_glock18_dropped", 17 | "w_pist_hkp2000_dropped", 18 | "w_pist_p250_dropped", 19 | "w_pist_tec9_dropped", 20 | "w_rif_ak47_dropped", 21 | "w_rif_aug_dropped", 22 | "w_rif_famas_dropped", 23 | "w_rif_galilar_dropped", 24 | "w_rif_m4a1_dropped", 25 | "w_rif_sg556_dropped", 26 | "w_shot_mag7_dropped", 27 | "w_shot_nova_dropped", 28 | "w_shot_sawedoff_dropped", 29 | "w_shot_xm1014_dropped", 30 | "w_smg_bizon_dropped", 31 | "w_smg_mac10_dropped", 32 | "w_smg_mp7_dropped", 33 | "w_smg_mp9_dropped", 34 | "w_smg_p90_dropped", 35 | "w_smg_ump45_dropped", 36 | "w_snip_awp_dropped", 37 | "w_snip_g3sg1_dropped", 38 | "w_snip_ssg08_dropped" 39 | ]; 40 | weapons <- [ 41 | "weapon_decoy", 42 | "weapon_flashbang", 43 | "weapon_hegrenade", 44 | "weapon_incgrenade", 45 | "weapon_molotov", 46 | "weapon_smokegrenade", 47 | "weapon_taser", 48 | "weapon_m249", 49 | "weapon_negev", 50 | "weapon_deagle", 51 | "weapon_elite", 52 | "weapon_fiveseven", 53 | "weapon_glock", 54 | "weapon_hkp2000", 55 | "weapon_p250", 56 | "weapon_tec9", 57 | "weapon_ak47", 58 | "weapon_aug", 59 | "weapon_famas", 60 | "weapon_galilar", 61 | "weapon_m4a1", 62 | "weapon_sg556", 63 | "weapon_mag7", 64 | "weapon_nova", 65 | "weapon_sawedoff", 66 | "weapon_xm1014", 67 | "weapon_bizon", 68 | "weapon_mac10", 69 | "weapon_mp7", 70 | "weapon_mp9", 71 | "weapon_p90", 72 | "weapon_ump45", 73 | "weapon_awp", 74 | "weapon_g3sg1", 75 | "weapon_ssg08" 76 | ]; 77 | 78 | function OnPostSpawn() 79 | { 80 | local ent=null 81 | while ((ent=Entities.FindByName(ent, "weapon_random")) != null) { 82 | local weapon=RandomInt(1,34) 83 | printl("Random weapon placed on "+ent+" , classname "+weapons[weapon]); 84 | local weapon_ent=CreateProp("prop_physics",ent.GetOrigin(),"models/weapons/"+weapons_models[weapon]+".mdl",0) 85 | weapon_ent.__KeyValueFromInt("spawnflags",256) 86 | weapon_ent.__KeyValueFromInt( "Solid", 6) 87 | EntFireByHandle(weapon_ent,"EnableMotion","",0.0,null,null); 88 | EntFireByHandle(weapon_ent,"Wake","",0.0,null,null); 89 | 90 | weapon_ent.ValidateScriptScope() 91 | 92 | local scope = weapon_ent.GetScriptScope() 93 | 94 | scope.classname<-weapons[weapon] 95 | scope.InputOnPlayerUse <- WeaponPickUp 96 | 97 | weapon_ent.ConnectOutput("OnPlayerUse","InputOnPlayerUse") 98 | 99 | } 100 | } 101 | 102 | function WeaponPickUp(){ 103 | 104 | local activator=Entities.FindByClassnameNearest("player",caller.GetOrigin(),200) //Activator for some reason return self 105 | 106 | GiveWeapon(activator,this.classname); 107 | this.self.Destroy() 108 | } 109 | 110 | -------------------------------------------------------------------------------- /vscriptthings/weapon_machine.nut: -------------------------------------------------------------------------------- 1 | DoIncludeScript("dev/instructor_hint.nut",null) 2 | DoIncludeScript("dev/give_weapons.nut",null) 3 | 4 | ::m_weapon_model<-EntityGroup[1]; 5 | ::m_weapon_light<-EntityGroup[2]; 6 | ::m_weapon_button<-EntityGroup[3]; 7 | ::m_IsChoosing<-false; 8 | ::m_activator<-null; 9 | ::m_nextrandomize<-0; 10 | ::m_chooseleft<-0; 11 | ::m_weaponid<-0; 12 | weapons_models <- [ 13 | "w_eq_decoy", 14 | "w_eq_flashbang", 15 | "w_eq_fraggrenade", 16 | "w_eq_incendiarygrenade", 17 | "w_eq_molotov", 18 | "w_eq_smokegrenade", 19 | "w_eq_taser", 20 | "w_mach_negev", 21 | "w_pist_deagle", 22 | "w_pist_elite", 23 | "w_pist_fiveseven", 24 | "w_pist_glock18", 25 | "w_pist_hkp2000", 26 | "w_pist_p250", 27 | "w_pist_tec9", 28 | "w_rif_ak47", 29 | "w_rif_aug", 30 | "w_rif_famas", 31 | "w_rif_galilar", 32 | "w_rif_m4a1", 33 | "w_rif_sg556", 34 | "w_shot_mag7", 35 | "w_shot_nova", 36 | "w_shot_sawedoff", 37 | "w_shot_xm1014", 38 | "w_smg_bizon", 39 | "w_smg_mac10", 40 | "w_smg_mp7", 41 | "w_smg_mp9", 42 | "w_smg_p90", 43 | "w_smg_ump45", 44 | "w_snip_awp", 45 | "w_snip_g3sg1", 46 | "w_snip_ssg08" //34 47 | ]; 48 | weapons <- [ 49 | "weapon_decoy", 50 | "weapon_flashbang", 51 | "weapon_hegrenade", 52 | "weapon_incgrenade", 53 | "weapon_molotov", 54 | "weapon_smokegrenade", 55 | "weapon_taser", 56 | "weapon_negev", 57 | "weapon_deagle", 58 | "weapon_elite", 59 | "weapon_fiveseven", 60 | "weapon_glock", 61 | "weapon_hkp2000", 62 | "weapon_p250", 63 | "weapon_tec9", 64 | "weapon_ak47", 65 | "weapon_aug", 66 | "weapon_famas", 67 | "weapon_galilar", 68 | "weapon_m4a1", 69 | "weapon_sg556", 70 | "weapon_mag7", 71 | "weapon_nova", 72 | "weapon_sawedoff", 73 | "weapon_xm1014", 74 | "weapon_bizon", 75 | "weapon_mac10", 76 | "weapon_mp7", 77 | "weapon_mp9", 78 | "weapon_p90", 79 | "weapon_ump45", 80 | "weapon_awp", 81 | "weapon_g3sg1", 82 | "weapon_ssg08" 83 | ]; 84 | Think <- function(){ 85 | if (::m_IsChoosing&&::m_chooseleft>0&&::m_nextrandomize