Permalink
Browse files

Update heavy armor test plugin

  • Loading branch information...
Bara committed May 20, 2018
1 parent 9456e78 commit 389725569f859651a31155b2caff77fa99e3b9f5
Showing with 14 additions and 36 deletions.
  1. +14 −36 addons/sourcemod/scripting/tests/removeHeavy.sp
@@ -3,57 +3,35 @@
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <ttt>
int g_iHeavyID[MAXPLAYERS+1] = { -1, ...};
char g_sModel[MAXPLAYERS + 1];
public void OnPluginStart()
{
RegAdminCmd("sm_heavy", Command_Heavy, ADMFLAG_ROOT);
RegAdminCmd("sm_gheavy", Command_GHeavy, ADMFLAG_ROOT);
RegAdminCmd("sm_rheavy", Command_RHeavy, ADMFLAG_ROOT);
RegAdminCmd("sm_end", Command_End, ADMFLAG_ROOT);
RegAdminCmd("sm_count", Command_Count, ADMFLAG_ROOT);
}
public Action Command_Heavy(int client, int args)
public Action Command_GHeavy(int client, int args)
{
g_iHeavyID[client] = GivePlayerItem(client, "item_heavyassaultsuit");
PrintToChat(client, "Player: %N, Heavy: %d", client, g_iHeavyID[client]);
}
public Action Command_RHeavy(int client, int args)
{
PrintToChat(client, "m_bHasHelmet == %b", GetEntProp(client, Prop_Send, "m_bHasHelmet"));
PrintToChat(client, "m_bHasHeavyArmor == %b", GetEntProp(client, Prop_Send, "m_bHasHeavyArmor"));
PrintToChat(client, "m_bWearingSuit == %b", GetEntProp(client, Prop_Send, "m_bWearingSuit"));
PrintToChat(client, "m_ArmorValue == %d", GetEntProp(client, Prop_Data, "m_ArmorValue"));
GetClientModel(client, g_sModel[client], sizeof(g_sModel[]));
SetEntProp(client, Prop_Send, "m_bHasHelmet", false);
SetEntProp(client, Prop_Send, "m_bHasHeavyArmor", false);
SetEntProp(client, Prop_Send, "m_bWearingSuit", false);
SetEntProp(client, Prop_Data, "m_ArmorValue", 0);
RequestFrame(Frame_CheckArmor, GetClientUserId(client));
GivePlayerItem(client, "item_heavyassaultsuit");
}
public void Frame_CheckArmor(int userid)
public Action Command_RHeavy(int client, int args)
{
int client = GetClientOfUserId(userid);
if (TTT_IsClientValid(client))
if (GetEntProp(client, Prop_Send, "m_bHasHeavyArmor"))
{
PrintToChat(client, "m_bHasHelmet == %b", GetEntProp(client, Prop_Send, "m_bHasHelmet"));
PrintToChat(client, "m_bHasHeavyArmor == %b", GetEntProp(client, Prop_Send, "m_bHasHeavyArmor"));
PrintToChat(client, "m_bWearingSuit == %b", GetEntProp(client, Prop_Send, "m_bWearingSuit"));
PrintToChat(client, "m_ArmorValue == %b", GetEntProp(client, Prop_Data, "m_ArmorValue"));
}
}
PrintToChat(client, "m_ArmorValue == %d", GetEntProp(client, Prop_Data, "m_ArmorValue"));
public Action Command_End(int client, int args)
{
CS_TerminateRound(1.0, CSRoundEnd_CTSurrender, true);
}
SetEntProp(client, Prop_Send, "m_bHasHelmet", false);
SetEntProp(client, Prop_Send, "m_bHasHeavyArmor", false);
SetEntProp(client, Prop_Send, "m_bWearingSuit", false);
SetEntProp(client, Prop_Data, "m_ArmorValue", 0);
public Action Command_Count(int client, int args)
{
PrintToChat(client, "GetClientCount: %d, Ingame: %d", GetClientCount(false), GetClientCount(true));
SetEntityModel(client, g_sModel[client]);
}
}

0 comments on commit 3897255

Please sign in to comment.