Skip to content
Permalink
Browse files

Add Bumpmine as traitor item

  • Loading branch information...
Bara committed May 1, 2019
1 parent 1b18c5f commit b1dee08c87f52cc914265765d9acdc6b7ba5f174
@@ -32,4 +32,5 @@
#define HAMMER_ITEM_SHORT "hammer"
#define AXE_ITEM_SHORT "axe"
#define SPANNER_ITEM_SHORT "spanner"
#define BREACHCHARGE_ITEM_SHORT "breach"
#define BREACHCHARGE_ITEM_SHORT "breach"
#define BUMPMINE_ITEM_SHORT "bumpmine"
@@ -31,6 +31,7 @@ ConVar g_cMP5SD_Long = null;
ConVar g_cM4_Long = null;
ConVar g_cAWP_Long = null;
ConVar g_cBC_Long = null;
ConVar g_cBM_Long = null;
ConVar g_cKF_Long = null;
ConVar g_cAK_Long = null;
ConVar g_cDeagle_Long = null;
@@ -53,6 +54,9 @@ ConVar g_cAWP_Max_Shots = null;
ConVar g_cBC_Price = null;
ConVar g_cBC_Min = null;
ConVar g_cBC_Max = null;
ConVar g_cBM_Price = null;
ConVar g_cBM_Min = null;
ConVar g_cBM_Max = null;
ConVar g_cKnife_Price = null;
ConVar g_cKev_Max = null;
ConVar g_cHeavy_Max = null;
@@ -69,6 +73,7 @@ ConVar g_cMP5SD_Prio = null;
ConVar g_cM4_Prio = null;
ConVar g_cAWP_Prio = null;
ConVar g_cBC_Prio = null;
ConVar g_cBM_Prio = null;
ConVar g_cAK_Prio = null;
ConVar g_cAK_Price = null;
ConVar g_cDeagle_Prio = null;
@@ -148,7 +153,11 @@ public void OnPluginStart()
g_cBC_Price = AutoExecConfig_CreateConVar("bc_price", "3000", "The amount of credits the Breachcharge costs. 0 to disable.");
g_cBC_Min = AutoExecConfig_CreateConVar("bc_min", "1", "The min. amount of breachcharges.");
g_cBC_Max = AutoExecConfig_CreateConVar("bc_max", "3", "The max. amount of breachcharges.");
g_cBC_Prio = AutoExecConfig_CreateConVar("bc_sort_prio", "0", "The sorting priority of the Breachharge in the shop menu.");
g_cBC_Prio = AutoExecConfig_CreateConVar("bc_sort_prio", "0", "The sorting priority of the Breachcharge in the shop menu.");
g_cBM_Price = AutoExecConfig_CreateConVar("bm_price", "3000", "The amount of credits the bumpmine costs. 0 to disable.");
g_cBM_Min = AutoExecConfig_CreateConVar("bm_min", "1", "The min. amount of bumpmines.");
g_cBM_Max = AutoExecConfig_CreateConVar("bm_max", "3", "The max. amount of bumpmines.");
g_cBM_Prio = AutoExecConfig_CreateConVar("bm_sort_prio", "0", "The sorting priority of the bumpmine in the shop menu.");
g_cKnife_Price = AutoExecConfig_CreateConVar("oneknife_price", "3000", "The amount of credits the One-Hit Knife costs. 0 to disable.");
g_cKnife_Max = AutoExecConfig_CreateConVar("oneknife_max", "5", "The max amount of times a player can purchase 1-knife in one round. 0 for unlimited.");
g_cKnife_Prio = AutoExecConfig_CreateConVar("oneknife_sort_prio", "0", "The sorting priority of the One-Hit Knife in the shop menu.");
@@ -165,6 +174,7 @@ public void OnPluginStart()
g_cM4_Long = AutoExecConfig_CreateConVar("m4a1_name", "M4A1-S", "The name of the M4A1-S in the shop menu.");
g_cAWP_Long = AutoExecConfig_CreateConVar("awp_name", "AWP", "The name of the AWP in the shop menu.");
g_cBC_Long = AutoExecConfig_CreateConVar("bc_name", "Breachcharge", "The name of the Breachcharge in the shop menu.");
g_cBM_Long = AutoExecConfig_CreateConVar("bm_name", "Bumpmine", "The name of the Bumpmine in the shop menu.");
g_cKF_Long = AutoExecConfig_CreateConVar("oneknife_name", "1-Hit Knife", "The name of the 1-hit knife in the shop menu.");
g_cHammer_Long = AutoExecConfig_CreateConVar("hammer_name", "Hammer", "The name of the Hammer in the shop menu.");
g_cHammer_Price = AutoExecConfig_CreateConVar("hammer_price", "3000", "The amount of credits the Hammer costs. 0 to disable.");
@@ -285,6 +295,9 @@ void RegisterItem()
g_cBC_Long.GetString(sBuffer, sizeof(sBuffer));
TTT_RegisterCustomItem(BREACHCHARGE_ITEM_SHORT, sBuffer, g_cBC_Price.IntValue, TTT_TEAM_TRAITOR, g_cBC_Prio.IntValue);

g_cBM_Long.GetString(sBuffer, sizeof(sBuffer));
TTT_RegisterCustomItem(BUMPMINE_ITEM_SHORT, sBuffer, g_cBM_Price.IntValue, TTT_TEAM_TRAITOR, g_cBM_Prio.IntValue);

g_cUSP_Long.GetString(sBuffer, sizeof(sBuffer));
TTT_RegisterCustomItem(USP_ITEM_SHORT, sBuffer, g_cUSP_Price.IntValue, TTT_TEAM_TRAITOR, g_cUSP_Prio.IntValue);

@@ -526,7 +539,8 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
{
TTT_SetClientCredits(client, TTT_GetClientCredits(client) + g_cAWP_Price.IntValue);
}
}if(strcmp(itemshort, BREACHCHARGE_ITEM_SHORT, false) == 0)
}
if(strcmp(itemshort, BREACHCHARGE_ITEM_SHORT, false) == 0)
{
if (TTT_GetClientRole(client) != TTT_TEAM_TRAITOR)
{
@@ -550,6 +564,30 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
TTT_SetClientCredits(client, TTT_GetClientCredits(client) + g_cBC_Price.IntValue);
}
}
if(strcmp(itemshort, BUMPMINE_ITEM_SHORT, false) == 0)
{
if (TTT_GetClientRole(client) != TTT_TEAM_TRAITOR)
{
return Plugin_Stop;
}
if (GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY) != -1)
{
SDKHooks_DropWeapon(client, GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY));
}

int iBC = GivePlayerItem(client, "weapon_bumpmine");

if(iBC != -1)
{
EquipPlayerWeapon(client, iBC);
SetEntProp(iBC, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
SetEntProp(iBC, Prop_Send, "m_iClip1", GetRandomInt(g_cBM_Min.IntValue, g_cBM_Max.IntValue));
}
else
{
TTT_SetClientCredits(client, TTT_GetClientCredits(client) + g_cBM_Price.IntValue);
}
}
else if(strcmp(itemshort, KF_ITEM_SHORT, false) == 0)
{
if (TTT_GetClientRole(client) != TTT_TEAM_TRAITOR)

0 comments on commit b1dee08

Please sign in to comment.
You can’t perform that action at this time.