Skip to content
Merged

yeah #70

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions addons/sourcemod/gamedata/scp_sf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,13 @@
}
"CBasePlayer::EquipWearable"
{
"linux" "439"
"windows" "438"
"linux" "440"
"windows" "439"
}
"CBasePlayer::ForceRespawn"
{
"linux" "337"
"windows" "336"
"linux" "338"
"windows" "337"
}
"CTeamplayRoundBasedRules::RoundRespawn"
{
Expand All @@ -442,18 +442,18 @@
}
"CTeam::AddPlayer"
{
"linux" "209"
"windows" "208"
"linux" "210"
"windows" "209"
}
"CTeam::RemovePlayer"
{
"linux" "210"
"windows" "209"
"linux" "211"
"windows" "210"
}
"CBaseEntity::ModifyOrAppendCriteria"
{
"linux" "124"
"windows" "123"
"linux" "125"
"windows" "124"
}
}
"Addresses"
Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/scp_sf/items.sp
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ void Items_SetupViewmodel(int client, int weapon)
if (Weapon.ViewmodelName[0])
{
// all custom viewmodels follow this anim name convention
ViewModel_Create(client, Weapon.ViewmodelName, _, _, Weapon.Skin, false, true);
ViewModel_SetDefaultAnimation(client, "idle");
ViewModel_Create(client, Weapon.ViewmodelName, _, _, Weapon.Skin, false, true, "idle");
ViewModel_SetAnimation(client, "draw");
}
}
Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/scp_sf/maps/szf.sp
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ public void SZF_106Button(int client, int button)
if(weapon > MaxClients)
TF2Attrib_SetByDefIndex(weapon, 821, 0.0);

ViewModel_Create(client, ModelMelee);
ViewModel_SetDefaultAnimation(client, "a_fists_idle_02");
ViewModel_Create(client, ModelMelee, .sDefaultAnim = "a_fists_idle_02");
TF2_RemoveCondition(client, TFCond_SpeedBuffAlly);
TF2_RemoveCondition(client, TFCond_StealthedUserBuffFade);
TF2_RemoveCondition(client, TFCond_DodgeChance);
Expand Down
6 changes: 2 additions & 4 deletions addons/sourcemod/scripting/scp_sf/scps/049.sp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ public void SCP049_OnWeaponSwitch(int client, int entity)
Revive[client].GoneAt = GetGameTime()+3.0;
}

ViewModel_Create(client, ModelMedi);
ViewModel_SetDefaultAnimation(client, "b_idle");
ViewModel_Create(client, ModelMedi, .sDefaultAnim = "b_idle");
ViewModel_SetAnimation(client, "b_draw");
}
}
Expand Down Expand Up @@ -333,8 +332,7 @@ public void SCP049_OnButton(int client, int button)

FakeClientCommandEx(client, "voicemenu 1 6"); // Activate charge

ViewModel_Create(client, ModelMelee);
ViewModel_SetDefaultAnimation(client, "b_idle");
ViewModel_Create(client, ModelMelee, .sDefaultAnim = "b_idle");
ViewModel_SetAnimation(client, "b_draw");
}

Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/scp_sf/scps/096.sp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public void SCP096_OnButton(int client, int button)
SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
}

ViewModel_Create(client, ModelMelee);
ViewModel_SetDefaultAnimation(client, "a_fists_idle_02");
ViewModel_Create(client, ModelMelee, .sDefaultAnim = "a_fists_idle_02");
ViewModel_SetAnimation(client, "a_fists_idle_02");
}
}
Expand Down
3 changes: 1 addition & 2 deletions addons/sourcemod/scripting/scp_sf/scps/106.sp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public bool SCP106_Create(int client)
SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", weapon);
}

ViewModel_Create(client, ModelMelee);
ViewModel_SetDefaultAnimation(client, "a_fists_idle_02");
ViewModel_Create(client, ModelMelee, .sDefaultAnim = "a_fists_idle_02");
ViewModel_SetAnimation(client, "fists_draw");
return false;
}
Expand Down
14 changes: 4 additions & 10 deletions addons/sourcemod/scripting/scp_sf/viewmodels.sp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

static int ViewmodelRef[MAXPLAYERS + 1] = {INVALID_ENT_REFERENCE, ...};

int ViewModel_Create(int iClient, const char[] sModel, const float vecAnglesOffset[3] = NULL_VECTOR, float flHeight = 0.0, int Skin = 0, bool ViewChange = true, bool NeedsHands = false)
int ViewModel_Create(int iClient, const char[] sModel, const float vecAnglesOffset[3] = NULL_VECTOR, float flHeight = 0.0, int Skin = 0, bool ViewChange = true, bool NeedsHands = false, const char[] sDefaultAnim = "")
{
int iViewModel = CreateEntityByName("prop_dynamic");
if (iViewModel <= MaxClients)
Expand All @@ -18,6 +18,9 @@ int ViewModel_Create(int iClient, const char[] sModel, const float vecAnglesOffs
DispatchKeyValue(iViewModel, "disablereceiveshadows", "0");
DispatchKeyValue(iViewModel, "disableshadows", "1");

if (sDefaultAnim[0])
DispatchKeyValue(iViewModel, "defaultanim", sDefaultAnim);

float vecOrigin[3], vecAngles[3];
GetClientAbsOrigin(iClient, vecOrigin);
GetClientAbsAngles(iClient, vecAngles);
Expand Down Expand Up @@ -89,15 +92,6 @@ void ViewModel_SetAnimation(int iClient, const char[] sAnimation)
}
}

void ViewModel_SetDefaultAnimation(int iClient, const char[] sAnimation)
{
if (ViewModel_Valid(iClient))
{
SetVariantString(sAnimation);
AcceptEntityInput(ViewmodelRef[iClient], "SetDefaultAnimation");
}
}

void ViewModel_Destroy(int iClient)
{
if (ViewModel_Valid(iClient))
Expand Down
Loading