block load
{
	es_xset est_footstep 0
	es_xset est_alive 0
	es_xset weapon 0
	es_xset est_format1 0
	es_xset est_weaponname 0
	es_xset est_weapon_name 0
	es_xset est_tmpvar 0
	es_xset est_tmpvar1 0
	es_xset est_prop 0
	es_xset propmenu 0
	es_xset est_type 0
	es_xset target 0
	es_xset vector1 0
	es_xset vector2 0
	es_xset est_overlay 0
	es_xset est_teffect 0
	es_xset est_cteffect 0
	es_xsetinfo teleon 1
	es_xsetinfo showtpmenu 0
	es_xsetinfo tpmuse 0
	es_xsetinfo stpx 0
	es_xsetinfo stpy 0
	es_xsetinfo stpz 0
	es_xsetinfo etpx 0
	es_xsetinfo etpy 0
	es_xsetinfo tpid 0
	es_xsetinfo tpid2 0
	es_xsetinfo teid 0
	es_xsetinfo etpz 0
	alias addstele "alias showsportal es_delayed 3 es_doblock est_admin/est_command/portal_scycle; es_getplayerlocation stpx stpy stpz server_var(teid); es_math stpz + 15; es_doblock est_admin/est_command/portal_scycle"
	alias addetele "alias showeportal es_delayed 3 es_doblock est_admin/est_command/portal_ecycle; es_getplayerlocation etpx etpy etpz server_var(teid); es_math etpz + 15; es_setinfo dotele 1; es_doblock est_admin/est_command/tele; es_doblock est_admin/est_command/portal_ecycle"
	alias deltele "es_setinfo dotele 0;alias showsportal 0"
	es_xsetinfo stpx2 0
	es_xsetinfo stpy2 0
	es_xsetinfo stpz2 0
	es_xsetinfo etpx2 0
	es_xsetinfo etpy2 0
	es_xsetinfo etpz2 0
	es_xset est_delete_props 0
	alias addstele2 "alias showsportal2 es_delayed 3 es_doblock est_admin/est_command/portal_scycle2; es_getplayerlocation stpx2 stpy2 stpz2 server_var(teid); es_math stpz2 + 15; es_doblock est_admin/est_command/portal_scycle2"
	alias addetele2 "alias showeportal2 es_delayed 3 es_doblock est_admin/est_command/portal_ecycle2; es_getplayerlocation etpx2 etpy2 etpz2 server_var(teid); es_math etpz2 + 15; es_setinfo dotele2 1; es_doblock est_admin/est_command/tele2; es_doblock est_admin/est_command/portal_ecycle2"
	alias deltele2 "es_setinfo dotele2 0; alias showeportal2 0; alias showsportal2 0"
	popup create portal
	popup addline portal "   -Portal-"
	popup addline portal "->1.Create Portal [A]"
	popup addline portal "->2.Create Portal [B]"
	popup addline portal "->3.Delete Portal [A] and [B]"
	popup addline portal "->8.Back"
	popup addline portal "->0.Exit"
	es_xset est_addon -Scripts
	es_xkeygroupcreate est_command
	es_xkeygroupload est_command |est_admin/est_command
	popup menuselect portal est_admin/est_command/portal
	es_xkeygetvalue est_admin_command est_admin_config est_settings admin_command
	es_xkeygetvalue est_delete_props est_admin_config est_settings delete_props
	es_regclientcmd server_var(est_admin_command) est_admin/est_command/est_command "bind est_command"
	es_regsaycmd server_var(est_admin_command) est_admin/est_command/est_command "bind est_command"
	es_regclientcmd server_var(est_delete_props) est_admin/est_command/deleteprop "delete props"
	es_regsaycmd server_var(est_delete_props) est_admin/est_command/deleteprop "delete props"
}

block unload
{
	es_xkeygroupdelete est_command
}

block est_command
{
	es_xgetcmduserid est_userid
	es est_getsteam est_id server_var(est_userid)
	es_keygetvalue est_tmp est_admin server_var(est_id) est_command
	if (server_var(est_tmp) = noclip) do
	{
		es_xdoblock est_admin/est_command/noclip
		es colormsg server_var(est_userid) #grey Noclip #green Active
	}
	if (server_var(est_tmp) = clipno) do
	{
		es_xdoblock est_admin/est_command/clipno
		es colormsg server_var(est_userid) #grey Noclip #green DeActive
	}
	if (server_var(est_tmp) = force_field) do
	{
		es_xdoblock est_admin/est_command/forcefield
		es colormsg server_var(est_userid) #grey Force Field #green Active
	}
	if (server_var(est_tmp) = no_force_field) do
	{
		es_xdoblock est_admin/est_command/no_forcefield
		es colormsg server_var(est_userid) #grey Force Field #green DeActive
	}
	if (server_var(est_tmp) = props) do
	{
		es_xdoblock est_admin/est_command/props
	}
	if (server_var(est_tmp) = physbeam) do
	{
		es_xdoblock est_admin/est_command/physbeam
	}
	if (server_var(est_tmp) = infrared) do
	{
		es_xdoblock est_admin/est_command/infrared
		es colormsg server_var(est_userid) #grey Infrared #green DeActive
	}
	if (server_var(est_tmp) = no_infrared) do
	{
		es_xdoblock est_admin/est_command/no_infrared
		es colormsg server_var(est_userid) #grey Infrared #green Active
	}
	if (server_var(est_tmp) = helicopter) do
	{
		es_xdoblock est_admin/est_command/helicopter
		es colormsg server_var(est_userid) #grey Helicopter #green Active
	}
	if (server_var(est_tmp) = no_helicopter) do
	{
		es_xdoblock est_admin/est_command/no_helicopter
		es colormsg server_var(est_userid) #grey Helicopter #green DeActive
	}
	if (server_var(est_tmp) = explode) do
	{
		es_xdoblock est_admin/est_command/explode
	}
	if (server_var(est_tmp) = freeze) do
	{
		es_xdoblock est_admin/est_command/explode
	}
	if (server_var(est_tmp) = burn) do
	{
		es_xdoblock est_admin/est_command/explode
	}
	if (server_var(est_tmp) = exploding_shots) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command no_exploding_shots
		es colormsg server_var(est_userid) #grey Exploding Shots #green DeActive
	}
	if (server_var(est_tmp) = no_exploding_shots) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command exploding_shots
		es colormsg server_var(est_userid) #grey Exploding Shots #green Active
	}
	if (server_var(est_tmp) = rapid_fire) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command no_rapid_fire
		es colormsg server_var(est_userid) #grey Rapid Fire #green DeActive
	}
	if (server_var(est_tmp) = no_rapid_fire) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command rapid_fire
		es colormsg server_var(est_userid) #grey Rapid Fire #green Active
	}
	if (server_var(est_tmp) = flames) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command no_flames
		es colormsg server_var(est_userid) #grey Flames #green DeActive
	}
	if (server_var(est_tmp) = no_flames) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command flames
		es colormsg server_var(est_userid) #grey Flames #green Active
	}
}

block physbeam
{
	es_xset beamtime 9
	es_xset entityCount 0
	es_xset mySmokeName ""
	es_xformatv mySmokeName "smoke_%1" entityCount
	es_entcreate server_var(est_userid) point_push
	es est_SetEntName server_var(eventscripts_lastgive) server_var(mySmokeName)
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "radius 120"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "magnitude 350"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "inner_radius 100"
	es_fire server_var(est_userid) server_var(mySmokeName) enable
	es_xmath beamtime + 9
	es_delayed 28 es_fire server_var(est_userid) server_var(mySmokeName) disable
	es_xmath entityCount + 1
	es est_getviewcoord server_var(est_userid) est_x1 est_y1 est_z1
	es es_xgetplayerlocation  est_x est_y est_z server_var(est_userid)
	es est_getviewcoord server_var(est_userid) est_x2 est_y2 est_z2
	es_xmath est_z2 + 25
	es_xmath est_z + 55
	es est_effect 10 #a 0 sprites/bluelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) 20 50 1 3 30 0 255 25 25 255 10
	es_delayed 9 es est_effect 10 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) 20 50 1 4 30 0 255 25 25 255 10
	es est_Effect 3 #a 0 sprites/bluelight1.vmt server_var(est_x) server_var(est_y) server_var(est_z) server_var(est_x1) server_var(est_y1) server_var(est_z2) .2 .2 .3 255 25 25 255
	es est_Effect 3 #a 0 sprites/bluelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 25 25 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 5 255 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a .1 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 155 155 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 55 155 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.2 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 155 155 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 55 155 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.3 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 155 155 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 55 155 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.4 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 15 15 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 55 155 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.5 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 15 15 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 55 155 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.6 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 155 155 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 55 155 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.7 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 15 15 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 5 15 255 255
	es_xmath est_z2 + 25
	es est_Effect 3 #a 0.8 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 2 3 255 15 15 255
	es_delayed 9 es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) server_var(est_x2) server_var(est_y2) server_var(est_z2) server_var(beamtime) 1 1 5 15 255 255
}

block noclip
{
	es est_noclip server_var(est_userid) 1
	es_keysetvalue est_admin server_var(est_id) est_command clipno
}

block clipno
{
	es est_noclip server_var(est_userid) 0
	es_keysetvalue est_admin server_var(est_id) est_command noclip
}

block forcefield
{
	es est_getsteam est_id server_var(est_userid)
	es_keysetvalue est_admin server_var(est_id) est_command no_force_field
	es_xset entityCount 0
	es_xset mySmokeName ""
	es_xformatv mySmokeName "smoke_%1" entityCount
	es_give server_var(est_userid) env_Smokestack
	es est_SetEntName server_var(eventscripts_lastgive) server_var(mySmokeName)
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "basespread 100"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "spreadspeed 1"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "speed 100"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "rate 50"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "startsize 6"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "endsize 3"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "twist 90"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "jetlength 90"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "rendercolor 255 216 115"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "SmokeMaterial particle\fire.vmt"
	es_fire server_var(est_userid) server_var(mySmokeName) setparent !activator
	es_fire server_var(est_userid) server_var(mySmokeName) turnon
	es est_god server_var(est_userid) 1
	es est_csay server_var(est_userid) Shield Activated
	es est_playplayer server_var(est_userid) ambient/levels/citadel/weapon_disintegrate2.wav
	es_delayed 1 es est_playplayer server_var(est_userid) ambient\levels\citadel\zapper_ambient_loop1.wav
	es_xset entityCount 0
	es_xset mySmokeName ""
	es_xformatv mySmokeName "smoke_%1" entityCount
	es_give server_var(est_userid) env_Smokestack
	es_give server_var(est_userid) point_push
	es est_SetEntName server_var(eventscripts_lastgive) server_var(mySmokeName)
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "magnitude 480"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "radius 130"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "inner_radius 480"
	es_fire server_var(est_userid) server_var(mySmokeName) addoutput "spawnflags 4"
	es_fire server_var(est_userid) server_var(mySmokeName) enable
	es_fire server_var(est_userid) server_var(mySmokeName) setparent !activator
}

block no_forcefield
{
	es est_getsteam est_id server_var(est_userid)
	es es_keysetvalue est_admin server_var(est_id) est_command force_field
	es est_god server_var(est_userid) 0
	es_fire server_var(est_userid) server_var(mySmokeName) kill
	es est_csay server_var(est_userid) Shield Deactivated
	es est_playplayer server_var(est_userid) ambient/levels/citadel/weapon_disintegrate1.wav
	es est_stopsound server_var(est_userid) ambient\levels\citadel\zapper_ambient_loop1.wav
	es_delayed 1 es est_stopsound server_var(est_userid) ambient\levels\citadel\zapper_ambient_loop1.wav
	es_fire server_var(est_userid) server_var(mySmokeName) disable
}

block infrared
{
	es repeat stop server_var(est_id)
	es repeat delete server_var(est_id)
	es est_getsteam est_id server_var(est_userid)
	es_keygetvalue est_tmp1 est_admin server_var(est_id) est_command
	es est_playplayer server_var(est_userid) items/nvg_off.wav
	if (server_var(est_tmp1) = infrared) then es_cexec server_var(est_userid) r_screenoverlay 0
	if (server_var(est_tmp1) = infrared) then es_keysetvalue est_admin server_var(est_id) est_command no_infrared
}

block no_infrared
{
	es est_getsteam est_id server_var(est_userid)
	es_keygetvalue est_tmp1 est_admin server_var(est_id) est_command
	es_xkeygetvalue est_overlay est_admin_config wallhack overlay
	es_xkeygetvalue est_teffect est_admin_config wallhack Tmodel
	es_xkeygetvalue est_cteffect est_admin_config wallhack CTmodel
	es est_playplayer server_var(est_userid) items/nvg_on.wav
	if (server_var(est_tmp1) = no_infrared) then es_cexec server_var(est_userid) r_screenoverlay effects/combine_binocoverlay.vmt
	if (server_var(est_tmp1) = no_infrared) then es_keysetvalue est_admin server_var(est_id) est_command infrared
	es repeat create server_var(est_id) "es_xdoblock est_admin/est_command/wallhack"
	es repeat start server_var(est_id) .1
}

block helicopter
{
	es est_getsteam est_id server_var(est_userid)
	es es_xkeysetvalue est_admin server_var(est_id) est_command no_helicopter
	es est_getprimary weapon server_var(est_userid)
	es est_removeweapon server_var(est_userid) 1
	es_delayed .2 es_give server_var(est_userid) weapon_m249
	es_delayed 1.2 est_setclipammo server_var(est_userid) 1 200
	es playerset model server_var(est_userid) combine_helicopter
	es_delayed 1 est_physpush server_var(est_userid) 0 0 500
	es_delayed 1 est_jetpack server_var(est_userid) 1
	es est_playplayer server_var(est_userid) ambient/machines/heli_pass_quick1.wav
	es est_playplayer server_var(est_userid) npc/attack_helicopter/aheli_rotor_loop1.wav
}

block no_helicopter
{
	es est_getsteam est_id server_var(est_userid)
	es est_getteam est_tmpvar server_var(est_userid)
	es est_playplayer server_var(est_userid) ambient/machines/spindown.wav
	es est_stopsound server_var(est_userid) ambient/machines/heli_pass_quick1.wav
	es_delayed 1 est_stopsound server_var(est_userid) npc/attack_helicopter/aheli_rotor_loop1.wav
	es est_removeweapon server_var(est_userid) 1
	es_delayed .2 est_give server_var(est_userid) server_var(weapon)
	es_delayed 1 est_jetpack server_var(est_userid) 0
	es_delayed 3 es est_stopsound server_var(est_userid) npc/attack_helico pter/aheli_rotor_loop1.wav
	if (server_var(est_tmpvar) = 2) then es playerset model server_var(est_userid) player/t_phoenix
	if (server_var(est_tmpvar) = 3) then es playerset model server_var(est_userid) player/ct_urban
	es_keysetvalue est_admin server_var(est_id) est_command helicopter
}

block props
{
	es est_getsteam est_id server_var(est_userid)
	es_keygetvalue x5 est_admin server_var(est_id) spawnprop
	es_keygetvalue x6 est_admin server_var(est_id) proptype
	es_keygetvalue x7 est_admin server_var(est_id) prop_sound1
	es_keygetvalue x8 est_admin server_var(est_id) prop_sound2
	es_keygetvalue x9 est_admin server_var(est_id) prop_animation1
	es_keygetvalue o1 est_admin server_var(est_id) prop_animation2
	es_keygetvalue o2 server_var(propsubmenu) server_var(selected_prop) dissolve
	es_set eventscripts_lastgive server_var(est_prop)
	if (server_var(x6) = physics) then es_prop_physics_create server_var(est_userid) server_var(x5)
	if (server_var(x6) = dynamic) then es_prop_dynamic_create server_var(est_userid) server_var(x5)
	if (server_var(x7) != 0) then es_emitsound entity server_var(eventscripts_lastgive) server_var(x7) 1.0 0.5
	if (server_var(x8) != 0) then es_emitsound entity server_var(eventscripts_lastgive) server_var(x8) 1.0 0.5
	if (server_var(x9) != 0) then es_entsetname server_var(est_userid) server_var(est_prop)
	if (server_var(x9) != 0) then es_fire server_var(est_userid) server_var(est_prop) setanimation server_var(x9)
	if (server_var(o1) != 0) then es_delayed 4 es_fire server_var(est_userid) server_var(est_prop) setanimation server_var(o1)
	if (server_var(o2) != 0) then es_delayed server_var(o2) es est_dissolve server_var(eventscripts_lastgive)
}

block deleteprop
{
	es_xgetcmduserid est_userid
	es est_getviewprop server_var(est_userid) propdele
	es est_getviewplayer server_var(est_userid) propdele1
	if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then es est_dissolve server_var(propdele)
}

block explode
{
	es_xgetcmduserid est_userid
	es est_getsteam est_id server_var(est_userid)
	es_keygetvalue est_tmp est_admin server_var(est_id) est_command
	if (server_var(est_tmp) = explode) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command freeze
	}
	if (server_var(est_tmp) = freeze) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command burn
	}
	if (server_var(est_tmp) = burn) do
	{
		es_keysetvalue est_admin server_var(est_id) est_command explode
	}
}

block wallhack
{
	es est_Near targetid #c 20000 server_var(est_userid) "es est_isalive est_alive server_var(targetid);es es_xgetplayerlocation est_x1 est_y1 est_z1 server_var(targetid);es_xmath est_z1 + 33;if (server_var(est_alive) = 1) then if (server_var(targetid) != server_var(est_userid)) then es est_effect 11 server_var(est_userid) 0 server_var(est_cteffect) server_var(est_x1) server_var(est_y1) server_var(est_z1) .2 .3 255"
	es est_Near targetid #t 20000 server_var(est_userid) "es est_isalive est_alive server_var(targetid);es es_xgetplayerlocation est_x1 est_y1 est_z1 server_var(targetid);es_xmath est_z1 + 33;if (server_var(est_alive) = 1) then if (server_var(targetid) != server_var(est_userid)) then es est_effect 11 server_var(est_userid) 0 server_var(est_teffect) server_var(est_x1) server_var(est_y1) server_var(est_z1) .2 .3 255"
}


event weapon_fire
{
	es est_getsteam est_id event_var(userid)
	es_keygetvalue est_tmp est_admin server_var(est_id) est_command
	if (server_var(est_tmp) = explode) do
	{
		if (event_var(weapon) = knife) do
		{
			es est_playplayer event_var(userid) ^weapons/hegrenade/explode5.wav .1
			es est_getviewplayer event_var(userid) est_target
			es es_xgetplayerlocation est_x1 est_y1 est_z1 event_var(userid)
			es est_getviewcoord event_var(userid) est_x2 est_y2 est_z2
			es_xmath est_z1 + 50
			es_createvectorstring vector1 server_var(est_x1) server_var(est_y1) server_var(est_z1)
			es_createvectorstring vector2 server_var(est_x2) server_var(est_y2) server_var(est_z2)
			es est_Effect_06 #a 0 vgui/gfx/vgui/cs_logo.vmt server_var(vector1) server_var(vector2) 100 .3 11 1 10 5 255 5 5 255 100
			es est_effect_20 #a 0 sprites/lgtning.vmt server_var(vector2) 9 10 10 50 100 100 100
		}
	}
	if (server_var(est_tmp) = freeze) do
	{
		if (event_var(weapon) = knife) do
		{
			es est_getviewplayer event_var(userid) est_target
			es_xset vector1 est_z1
			es_xset vector2 est_z2
			es es_xgetplayerlocation est_x1 est_y1 est_z1 event_var(userid)
			es est_getviewcoord event_var(userid) est_x2 est_y2 est_z2
			es_xmath est_z1 + 50
			es_createvectorstring vector1 server_var(est_x1) server_var(est_y1) server_var(est_z1)
			es_createvectorstring vector2 server_var(est_x2) server_var(est_y2) server_var(est_z2)
			es est_Effect_06 #a 0 vgui/gfx/vgui/cs_logo.vmt server_var(vector1) server_var(vector2) 100 .3 11 1 10 5 5 5 255 255 100
			ifx true(est_target) do
			{
				es est_freeze server_var(est_target) 1
				es_delayed 1 es est_freeze server_var(est_target) 0
				es est_setplayercolor server_var(est_target) 0 0 255 255 1
				es_delayed 1 es est_setplayercolor server_var(est_target) 255 255 255 255 1
			}
		}
	}
	if (server_var(est_tmp) = burn) do
	{
		if (event_var(weapon) = knife) do
		{
			es est_playplayer event_var(userid) ^weapons/hegrenade/explode6.wav
			es est_getviewplayer event_var(userid) est_target
			es_xset vector1 est_z1
			es_xset vector2 est_z2
			es es_xgetplayerlocation est_x1 est_y1 est_z1 event_var(userid)
			es est_getviewcoord event_var(userid) est_x2 est_y2 est_z2
			es_xmath est_z1 + 50
			es_createvectorstring vector1 server_var(est_x1) server_var(est_y1) server_var(est_z1)
			es_createvectorstring vector2 server_var(est_x2) server_var(est_y2) server_var(est_z2)
			es est_Effect_06 #a 0 vgui/gfx/vgui/cs_logo.vmt server_var(vector1) server_var(vector2) 100 .3 11 1 10 5 255 128 5 255 100
			ifx true(est_target) do
			{
				es est_burn server_var(est_target) 1
			}
		}
	}
	if (server_var(est_tmp) = rapid_fire) do
	{
		es_xset turbofire 0
		es_xset gunname 0
		es_format gunname "weapon_%1" event_var(weapon)
		es est_getweaponindex turbofire event_var(userid) server_var(gunname)
		es_setindexprop server_var(turbofire) "CBaseCombatWeapon.LocalActiveWeaponData.m_flNextPrimaryAttack" 0
		es_setplayerprop event_var(userid) "CCSPlayer.baseclass.localdata.m_Local.m_vecPunchAngle" 0.000000,0.000000,0.000000
		es_setplayerprop event_var(userid) "CCSPlayer.baseclass.baseclass.bcc_localdata.m_flNextAttack" 1
		es_setplayerprop event_var(userid) "CCSPlayer.cslocaldata.m_iShotsFired" 0
		es est_getclipammo est_tmp1 event_var(userid) 1
		es est_getclipammo est_tmp event_var(userid) 2
		if (event_var(weapon) = awp) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons\awp\awp1.wav
		if (event_var(weapon) = elite) then if (server_var(est_tmp) > 0) then es est_playplayer event_var(userid) weapons/elite/elite-1.wav
		if (event_var(weapon) = glock) then if (server_var(est_tmp) > 0) then es est_playplayer event_var(userid) weapons/glock/glock18-1.wav
		if (event_var(weapon) = usp) then if (server_var(est_tmp) > 0) then es est_playplayer event_var(userid) weapons/usp/usp_unsil-1.wav
		if (event_var(weapon) = fiveseven) then if (server_var(est_tmp) > 0) then es est_playplayer event_var(userid) weapons/fiveseven/fiveseven-1.wav
		if (event_var(weapon) = p228) then if (server_var(est_tmp) > 0) then es est_playplayer event_var(userid) weapons/p228/p228-1.wav
		if (event_var(weapon) = deagle) then if (server_var(est_tmp) > 0) then es est_playplayer event_var(userid) weapons/DEagle/deagle-1.wav
		if (event_var(weapon) = p90) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/P90/P90-1.wav
		if (event_var(weapon) = Aug) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/aug/aug-1.wav
		if (event_var(weapon) = Tmp) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/tmp/tmp-1.wav
		if (event_var(weapon) = Mac10) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/glock/mac10-1.wav
		if (event_var(weapon) = Ak47) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/ak47/ak47-1.wav
		if (event_var(weapon) = M4a1) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/M4a1/M4a1-1.wav
		if (event_var(weapon) = m3) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/m3/m3-1.wav
		if (event_var(weapon) = xm1014) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/xm1014/xm1014-1.wav
		if (event_var(weapon) = m249) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/m249/m249-1.wav
		if (event_var(weapon) = Famas) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/Famas/Famas-1.wav
		if (event_var(weapon) = scout) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/scout/scout_fire-1.wav
		if (event_var(weapon) = Galil) then if (server_var(est_tmp1) > 0) then es est_playplayer event_var(userid) weapons/Galil/Galil-1.wav
		if (event_var(weapon) = knife) then es est_playplayer event_var(userid) weapons/knife/knife_slash2.wav
	}
}

event bullet_impact
{
	es est_getsteam est_id event_var(userid)
	es_keygetvalue est_tmp est_admin server_var(est_id) est_command
	if (server_var(est_tmp) = exploding_shots) do
	{
		es_give event_var(userid) env_explosion
		es_fire event_var(userid) env_explosion addoutput "imagnitude 10"
		es_fire event_var(userid) env_explosion addoutput "spawnflags 1"
		es_format coords "origin %1 %2 %3" event_var(x) event_var(y) event_var(z)
		es_fire event_var(userid) env_explosion addoutput server_var(coords)
		es_getplayerhandle owner event_var(userid)
		es_setindexprop server_var(eventscripts_lastgive) CBaseEntity.m_hOwnerEntity server_var(owner)
		es_fire event_var(userid) env_explosion explode
		es es_xgetplayerlocation est_x1 est_y1 est_z1 event_var(userid)
		es_xmath est_z1 + 50
		es est_Effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) event_var(x) event_var(y) event_var(z) 1 1 13 255 255 255 255
		es est_effect 11 #a .4 sprites/fire.vmt event_var(x) event_var(y) event_var(z) 3 1 255
		es est_Effect 3 #a 0 sprites/tp_beam001.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) event_var(x) event_var(y) event_var(z) 1 5 5 255 18 15 255
		es est_effect 3 #a 0 sprites/orangelight1.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) event_var(x) event_var(y) event_var(z) 1 3 9 255 55 55 255
		es est_playplayer event_var(userid) weapons/grenade_launcher1.wav
	}
	if (server_var(est_tmp) = flames) do
	{
		es est_playplayer event_var(userid) wc/spells/fireball.wav
		es es_xgetplayerlocation est_x1 est_y1 est_z1 event_var(userid)
		es est_getviewcoord event_var(userid) est_x2 est_y2 est_z2
		es est_getviewplayer event_var(userid) est_target
		es_xmath est_z1 + 50
		es_createvectorstring vector1 server_var(est_x1) server_var(est_y1) server_var(est_z1)
		es_createvectorstring vector2 server_var(est_x2) server_var(est_y2) server_var(est_z2)
		es est_Effect_06 #a 0 sprites/fire2.vmt server_var(vector2) server_var(vector1) 10 1 1 2 10 0 255 255 255 255 100
		es est_effect 11 #a .3 sprites/fire1.vmt server_var(est_x2) server_var(est_y2) server_var(est_z2) 1 1 255
		ifx true(target) do
		{
			es est_burn server_var(target) 1
		}
	}
	if (server_var(est_tmp) = no_helicopter) do
	{
		es est_playplayer event_var(userid) weapons/mortar/mortar_explode2.wav
		es es_xgetplayerlocation est_x1 est_y1 est_z1 event_var(userid)
		es est_getviewcoord event_var(userid) est_x2 est_y2 est_z2
		es_xmath est_z1 + 20
		es_xmath est_z2 + 20
		es est_Effect 3 #a 0 sprites/tp_beam001.vmt server_var(est_x1) server_var(est_y1) server_var(est_z1) event_var(x) event_var(y) event_var(z) 1 12 15 255 128 35 255
		es est_effect 11 #a 0 sprites/xfireball3.vmt event_var(x) event_var(y) event_var(z) 3 5 255
		es_give event_var(userid) env_explosion
		es_fire event_var(userid) env_explosion addoutput "imagnitude 100"
		es_fire event_var(userid) env_explosion addoutput "Radius 10000"
		es_fire event_var(userid) env_explosion addoutput "spawnflags 1"
		es_format coords "origin %1 %2 %3" event_var(x) event_var(y) event_var(z)
		es_fire event_var(userid) env_explosion addoutput server_var(coords)
		es_fire event_var(userid) env_explosion explode
		es_getplayerhandle owner event_var(userid)
		es_setindexprop server_var(eventscripts_lastgive) CBaseEntity.m_hOwnerEntity server_var(owner)
	}
}

block portal_scycle
{
	showsportal
	es_xkeygetvalue est_tmp est_admin_config portal model
	es est_effect 11 #a 0 server_var(est_tmp) server_var(stpx) server_var(stpy) server_var(stpz) 3 1 125
}

block portal_ecycle
{
	showeportal
	es_xkeygetvalue est_tmp1 est_admin_config portal model2
	es est_effect 11 #a 0 server_var(est_tmp1) server_var(etpx) server_var(etpy) server_var(etpz) 3 1 225
}

block tele
{
	if (server_var(dotele) = 1) do
	{
		es est_NearCoord tpid #a 35 server_var(stpx) server_var(stpy) server_var(stpz) "es est_teleport server_var(tpid) server_var(etpx) server_var(etpy) server_var(etpz);es_xdoblock est_admin/est_command/view"
		es_delayed .1 es est_NearCoord tpid #a 35 server_var(stpx) server_var(stpy) server_var(stpz) "es est_teleport server_var(tpid) server_var(etpx) server_var(etpy) server_var(etpz);es_xdoblock est_admin/est_command/view"
		es_delayed .2 es est_NearCoord tpid #a 35 server_var(stpx) server_var(stpy) server_var(stpz) "es est_teleport server_var(tpid) server_var(etpx) server_var(etpy) server_var(etpz);es_xdoblock est_admin/est_command/view"
		es_delayed .3 es est_NearCoord tpid #a 35 server_var(stpx) server_var(stpy) server_var(stpz) "es est_teleport server_var(tpid) server_var(etpx) server_var(etpy) server_var(etpz);es_xdoblock est_admin/est_command/view"
		es_delayed .4 es est_NearCoord tpid #a 35 server_var(stpx) server_var(stpy) server_var(stpz) "es est_teleport server_var(tpid) server_var(etpx) server_var(etpy) server_var(etpz);es_xdoblock est_admin/est_command/view"
		es_xdelayed .5 es_doblock est_admin/est_command/tele
	}
}

block portal
{
	if (server_var(_popup_choice) == 1) do
	{
		es_set teid server_var(_popup_userid)
		addstele
		es_xdelayed 120 es_setinfo tpmuse 0
		es_xdelayed .1 es_setinfo tpmuse 1
		es_xset dotele 0
		es popup send portal server_var(_popup_userid)
		es_tell server_var(teid) #green [A]: created!
	}
	if (server_var(_popup_choice) == 2) do
	{
		addetele
		es_xdelayed 120 es_setinfo tpmuse 0
		es_xdelayed 120 es_setinfo tpmuse 0
		es popup send portal server_var(_popup_userid)
		es_tell server_var(teid) #green [B]: created!
	}
	if (server_var(_popup_choice) == 3) do
	{
		deltele
		es_xset dotele 0
		es popup send portal server_var(_popup_userid)
		es_tell server_var(teid) #green [A=B]: deleted!
		es_xsetinfo teleon 0
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send features server_var(_popup_userid)
	}
}

block view
{
	es_xkeygetvalue est_tmp est_admin_config portal overlay
	es_xkeygetvalue est_tmp1 est_admin_config portal sound
	es est_playplayer server_var(tpid) server_var(est_tmp1)
	es_cexec server_var(tpid) r_screenoverlay server_var(est_tmp)
	es est_fade server_var(tpid) 0 1 1 0 0 0 255
	es_delayed 2 es_cexec server_var(tpid) r_screenoverlay 0
	es est_setplayercolor server_var(tpid) 255 255 255 0 1
	es_delayed 2 es est_setplayercolor server_var(tpid) 255 255 255 255 1
	es est_god server_var(tpid) 1
	es_delayed 2 es est_god server_var(tpid) 0
}
