Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Resources (v0.1.9)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwifruitDev committed Oct 26, 2020
1 parent 011d2cf commit 08feada
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 117 deletions.
104 changes: 94 additions & 10 deletions addons/sourcemod/scripting/amongus.sp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SourcePawn Help - puntero

#define MAJOR_REVISION "0"
#define MINOR_REVISION "1"
#define STABLE_REVISION "8"
#define STABLE_REVISION "9"
#define PLUGIN_VERSION MAJOR_REVISION..."."...MINOR_REVISION..."."...STABLE_REVISION

enum PlayerState
Expand Down Expand Up @@ -110,8 +110,8 @@ enum VentState

enum EmergencyButtonState
{
Emergency_NotNearButton = 0,
Emergency_NextToButton
Emergency_NotNearButton = 0, //player cannot press button
Emergency_NextToButton //player can press button
};


Expand Down Expand Up @@ -167,6 +167,91 @@ ConVar voiceEnable;

ArrayList g_aSpawnPoints;

char resources[][] =
{
//materials
"materials/models/amongus/player/spy/eyeball_l.vmt",
"materials/models/amongus/player/spy/eyeball_l.vtf",
"materials/models/amongus/player/spy/eyeball_r.vmt",
"materials/models/amongus/player/spy/eyeball_r.vtf",
"materials/models/amongus/player/spy/spy_black.vmt",
"materials/models/amongus/player/spy/spy_black.vtf",
"materials/models/amongus/player/spy/spy_blue.vmt",
"materials/models/amongus/player/spy/spy_blue.vtf",
"materials/models/amongus/player/spy/spy_brown.vmt",
"materials/models/amongus/player/spy/spy_brown.vtf",
"materials/models/amongus/player/spy/spy_cyan.vmt",
"materials/models/amongus/player/spy/spy_cyan.vtf",
"materials/models/amongus/player/spy/spy_green.vmt",
"materials/models/amongus/player/spy/spy_green.vtf",
"materials/models/amongus/player/spy/spy_head_black.vmt",
"materials/models/amongus/player/spy/spy_head_black.vtf",
"materials/models/amongus/player/spy/spy_head_blue.vmt",
"materials/models/amongus/player/spy/spy_head_blue.vtf",
"materials/models/amongus/player/spy/spy_head_brown.vmt",
"materials/models/amongus/player/spy/spy_head_brown.vtf",
"materials/models/amongus/player/spy/spy_head_cyan.vmt",
"materials/models/amongus/player/spy/spy_head_cyan.vtf",
"materials/models/amongus/player/spy/spy_head_green.vmt",
"materials/models/amongus/player/spy/spy_head_green.vtf",
"materials/models/amongus/player/spy/spy_head_lime.vmt",
"materials/models/amongus/player/spy/spy_head_lime.vtf",
"materials/models/amongus/player/spy/spy_head_orange.vmt",
"materials/models/amongus/player/spy/spy_head_orange.vtf",
"materials/models/amongus/player/spy/spy_head_pink.vmt",
"materials/models/amongus/player/spy/spy_head_pink.vtf",
"materials/models/amongus/player/spy/spy_head_purple.vmt",
"materials/models/amongus/player/spy/spy_head_purple.vtf",
"materials/models/amongus/player/spy/spy_head_red.vmt",
"materials/models/amongus/player/spy/spy_head_red.vtf",
"materials/models/amongus/player/spy/spy_head_white.vmt",
"materials/models/amongus/player/spy/spy_head_white.vtf",
"materials/models/amongus/player/spy/spy_head_yellow.vmt",
"materials/models/amongus/player/spy/spy_head_yellow.vtf",
"materials/models/amongus/player/spy/spy_lime.vmt",
"materials/models/amongus/player/spy/spy_lime.vtf",
"materials/models/amongus/player/spy/spy_orange.vmt",
"materials/models/amongus/player/spy/spy_orange.vtf",
"materials/models/amongus/player/spy/spy_pink.vmt",
"materials/models/amongus/player/spy/spy_pink.vtf",
"materials/models/amongus/player/spy/spy_purple.vmt",
"materials/models/amongus/player/spy/spy_purple.vtf",
"materials/models/amongus/player/spy/spy_red.vmt",
"materials/models/amongus/player/spy/spy_red.vtf",
"materials/models/amongus/player/spy/spy_white.vmt",
"materials/models/amongus/player/spy/spy_white.vtf",
"materials/models/amongus/player/spy/spy_yellow.vmt",
"materials/models/amongus/player/spy/spy_yellow.vtf",
"materials/models/prop_dock/emergency_button.vmt",
"materials/models/prop_dock/emergency_button.vtf",
"materials/models/prop_dock/emergency_button_glass.vmt",
"materials/models/prop_dock/emergency_button_glass.vmt",
"materials/models/prop_dock/emergency_button2.vmt",
"materials/models/prop_dock/emergency_button2.vmt",
//audio
"sound/amongus/emergencymeeting.mp3",
"sound/amongus/foundbody.mp3",
"sound/amongus/kill.mp3",
"sound/amongus/spawn.mp3",
//models
"models/amongus/player/spy.dx80.vtx",
"models/amongus/player/spy.dx90.vtx",
"models/amongus/player/spy.mdl",
"models/amongus/player/spy.phy",
"models/amongus/player/spy.sw.vtx",
"models/amongus/player/spy.vvd",
"models/prop_dock/emergency_button01.dx80.vtx",
"models/prop_dock/emergency_button01.dx90.vtx",
"models/prop_dock/emergency_button01.mdl",
"models/prop_dock/emergency_button01.sw.vtx",
"models/prop_dock/emergency_button01.vvd",
"models/prop_dock/emergency_button02.dx80.vtx",
"models/prop_dock/emergency_button02.dx90.vtx",
"models/prop_dock/emergency_button02.mdl",
"models/prop_dock/emergency_button02.sw.vtx",
"models/prop_dock/emergency_button02.vvd"
};

public Plugin myinfo =
{
name = "[TF2] Among Us",
Expand All @@ -185,13 +270,10 @@ public void OnMapStart()
PrecacheSound(KILL_SOUND, true);
PrecacheSound(SPAWN_SOUND, true);
int ent = -1;
if(g_aSpawnPoints == null)
g_aSpawnPoints = new ArrayList();
while((ent = FindEntityByClassname(ent, "info_player_teamspawn")) != -1)
{
g_aSpawnPoints = new ArrayList();
while((ent = FindEntityByClassname(ent, "info_player_teamspawn")) != -1)
{
g_aSpawnPoints.Push(ent);
}
g_aSpawnPoints.Push(ent); //set spawn locations in the map
}
while((ent = FindEntityByClassname(ent, "prop_dynamic")) != -1) //find the emergency button
{
Expand All @@ -200,9 +282,11 @@ public void OnMapStart()
if(StrContains(targetName,"emergency_button") != -1)
{
mapEmergencyButtonId = ent;
break; //this might break anything below this portion of the script... oh well
break;
}
}
for(int i = 0;i < sizeof(resources);i++)
AddFileToDownloadsTable(resources[i]); //add resources
}

public OnConfigsExecuted()
Expand Down
Binary file modified maps/tfau_example.bsp
Binary file not shown.
186 changes: 79 additions & 107 deletions mapsrc/tfau_example.vmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ versioninfo
{
"editorversion" "400"
"editorbuild" "8163"
"mapversion" "41"
"mapversion" "42"
"formatversion" "100"
"prefab" "0"
}
Expand All @@ -20,7 +20,7 @@ viewsettings
world
{
"id" "1"
"mapversion" "41"
"mapversion" "42"
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites_2fort"
"detailvbsp" "detail_2fort.vbsp"
Expand Down Expand Up @@ -1091,6 +1091,82 @@ world
}
}
solid
{
"id" "4814"
side
{
"id" "3018"
"plane" "(-320 544 320) (320 544 320) (256 512 320)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[-1 0 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3017"
"plane" "(-256 512 64) (256 512 64) (320 544 64)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[-1 0 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3016"
"plane" "(-320 544 64) (320 544 64) (320 544 320)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3015"
"plane" "(256 512 64) (-256 512 64) (-256 512 320)"
"material" "DEV/DEV_MEASUREWALL01D"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 256] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3014"
"plane" "(320 544 64) (256 512 64) (256 512 320)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3013"
"plane" "(-256 512 64) (-320 544 64) (-320 544 320)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "0 168 169"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "134"
side
Expand Down Expand Up @@ -11331,82 +11407,6 @@ world
"visgroupautoshown" "1"
}
}
solid
{
"id" "4814"
side
{
"id" "3018"
"plane" "(-320 544 320) (320 544 320) (256 512 320)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[-1 0 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3017"
"plane" "(-256 512 64) (256 512 64) (320 544 64)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[-1 0 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3016"
"plane" "(-320 544 64) (320 544 64) (320 544 320)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3015"
"plane" "(256 512 64) (-256 512 64) (-256 512 320)"
"material" "DEV/DEV_MEASUREWALL01D"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 256] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3014"
"plane" "(320 544 64) (256 512 64) (256 512 320)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3013"
"plane" "(-256 512 64) (-320 544 64) (-320 544 320)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "0 168 169"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
group
{
"id" "1320"
Expand Down Expand Up @@ -12226,34 +12226,6 @@ entity
}
}
entity
{
"id" "4662"
"classname" "env_fog_controller"
"angles" "0 0 0"
"farz" "-1"
"fogblend" "0"
"fogcolor" "0 0 0"
"fogcolor2" "0 0 0"
"fogdir" "1 0 0"
"fogenable" "1"
"fogend" "500.0"
"foglerptime" "0"
"fogmaxdensity" "1"
"fogstart" "0"
"maxdxlevel" "0"
"mindxlevel" "0"
"spawnflags" "0"
"use_angles" "0"
"origin" "0 32 192"
editor
{
"color" "255 255 255"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 1000]"
}
}
entity
{
"id" "4699"
"classname" "light_environment"
Expand Down Expand Up @@ -12309,7 +12281,7 @@ entity
{
"id" "4537"
"classname" "trigger_multiple"
"origin" "-0 0 112"
"origin" "0 0 112"
"spawnflags" "1"
"StartDisabled" "0"
"targetname" "trigger_emergencybutton"
Expand Down

0 comments on commit 08feada

Please sign in to comment.