Skip to content

Commit

Permalink
Update heavy armor test plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed May 20, 2018
1 parent 9456e78 commit f245c8b
Showing 1 changed file with 14 additions and 36 deletions.
50 changes: 14 additions & 36 deletions addons/sourcemod/scripting/tests/removeHeavy.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,35 @@
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <ttt>

int g_iHeavyID[MAXPLAYERS+1] = { -1, ...};
char g_sModel[MAXPLAYERS + 1][PLATFORM_MAX_PATH+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 f245c8b

Please sign in to comment.