༼ つ ◕_◕ ༽つ
Dont change code you dont need to change. (ノಠ益ಠ)ノ彡┻━┻
This commit is contained in:
parent
187a5441d9
commit
38853315a0
@ -12,12 +12,12 @@
|
|||||||
|
|
||||||
/* BOOLS */
|
/* BOOLS */
|
||||||
bool g_bEngineCSGO;
|
bool g_bEngineCSGO;
|
||||||
bool g_bHideHeadModels[MAXPLAYERS+1];
|
bool g_bHideCrown[MAXPLAYERS+1];
|
||||||
bool g_bHideDialog[MAXPLAYERS+1];
|
bool g_bHideDialog[MAXPLAYERS+1];
|
||||||
bool g_bProtection[MAXPLAYERS+1];
|
bool g_bProtection[MAXPLAYERS+1];
|
||||||
|
|
||||||
/* COOKIES */
|
/* COOKIES */
|
||||||
Handle g_hCookie_HideHeadModels;
|
Handle g_hCookie_HideCrown;
|
||||||
Handle g_hCookie_HideDialog;
|
Handle g_hCookie_HideDialog;
|
||||||
Handle g_hCookie_Protection;
|
Handle g_hCookie_Protection;
|
||||||
|
|
||||||
@ -74,16 +74,15 @@ public void OnPluginStart()
|
|||||||
g_hCVar_ProtectionMinimal2 = CreateConVar("sm_topdefenders_minimal_2", "30", "", FCVAR_NONE, true, 1.0, true, 64.0);
|
g_hCVar_ProtectionMinimal2 = CreateConVar("sm_topdefenders_minimal_2", "30", "", FCVAR_NONE, true, 1.0, true, 64.0);
|
||||||
g_hCVar_ProtectionMinimal3 = CreateConVar("sm_topdefenders_minimal_3", "45", "", FCVAR_NONE, true, 1.0, true, 64.0);
|
g_hCVar_ProtectionMinimal3 = CreateConVar("sm_topdefenders_minimal_3", "45", "", FCVAR_NONE, true, 1.0, true, 64.0);
|
||||||
|
|
||||||
g_hCookie_HideHeadModels = RegClientCookie("topdefenders_hideheadmodels", "", CookieAccess_Private);
|
g_hCookie_HideCrown = RegClientCookie("topdefenders_hidecrown", "", CookieAccess_Private);
|
||||||
g_hCookie_HideDialog = RegClientCookie("topdefenders_hidedialog", "", CookieAccess_Private);
|
g_hCookie_HideDialog = RegClientCookie("topdefenders_hidedialog", "", CookieAccess_Private);
|
||||||
g_hCookie_Protection = RegClientCookie("topdefenders_protection", "", CookieAccess_Private);
|
g_hCookie_Protection = RegClientCookie("topdefenders_protection", "", CookieAccess_Private);
|
||||||
|
|
||||||
CreateTimer(0.1, UpdateScoreboard, INVALID_HANDLE, TIMER_REPEAT);
|
CreateTimer(0.1, UpdateScoreboard, INVALID_HANDLE, TIMER_REPEAT);
|
||||||
CreateTimer(0.1, UpdateDialog, INVALID_HANDLE, TIMER_REPEAT);
|
CreateTimer(0.1, UpdateDialog, INVALID_HANDLE, TIMER_REPEAT);
|
||||||
|
|
||||||
RegConsoleCmd("sm_togglecrown", OnToggleHeadModels);
|
RegConsoleCmd("sm_togglecrown", OnToggleCrown);
|
||||||
RegConsoleCmd("sm_toggleskull", OnToggleHeadModels);
|
RegConsoleCmd("sm_toggleskull", OnToggleCrown);
|
||||||
RegConsoleCmd("sm_toggleheadmodels", OnToggleHeadModels);
|
|
||||||
RegConsoleCmd("sm_toggledialog", OnToggleDialog);
|
RegConsoleCmd("sm_toggledialog", OnToggleDialog);
|
||||||
RegConsoleCmd("sm_toggleimmunity", OnToggleImmunity);
|
RegConsoleCmd("sm_toggleimmunity", OnToggleImmunity);
|
||||||
|
|
||||||
@ -93,15 +92,15 @@ public void OnPluginStart()
|
|||||||
HookEvent("player_spawn", OnClientSpawn);
|
HookEvent("player_spawn", OnClientSpawn);
|
||||||
HookEvent("player_death", OnClientDeath);
|
HookEvent("player_death", OnClientDeath);
|
||||||
|
|
||||||
SetCookieMenuItem(MenuHandler_CookieMenu, 0, "PlayerRankings");
|
SetCookieMenuItem(MenuHandler_CookieMenu, 0, "Player Rankings");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public Action OnToggleHeadModels(int client, int args)
|
public Action OnToggleCrown(int client, int args)
|
||||||
{
|
{
|
||||||
ToggleHeadModels(client);
|
ToggleCrown(client);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,13 +125,13 @@ public Action OnToggleImmunity(int client, int args)
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void ToggleHeadModels(int client)
|
public void ToggleCrown(int client)
|
||||||
{
|
{
|
||||||
g_bHideHeadModels[client] = !g_bHideHeadModels[client];
|
g_bHideCrown[client] = !g_bHideCrown[client];
|
||||||
|
|
||||||
SetClientCookie(client, g_hCookie_HideHeadModels, g_bHideHeadModels[client] ? "1" : "");
|
SetClientCookie(client, g_hCookie_HideCrown, g_bHideCrown[client] ? "1" : "");
|
||||||
|
|
||||||
CPrintToChat(client, "{cyan}%t {white}%t", "Chat Prefix", g_bHideHeadModels[client] ? "Head Models Disabled" : "Head Models Enabled");
|
CPrintToChat(client, "{cyan}%t {white}%t", "Chat Prefix", g_bHideCrown[client] ? "Crown Disabled" : "Crown Enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -168,7 +167,7 @@ public void ShowSettingsMenu(int client)
|
|||||||
|
|
||||||
menu.SetTitle("%T", "Cookie Menu Title", client);
|
menu.SetTitle("%T", "Cookie Menu Title", client);
|
||||||
|
|
||||||
AddMenuItemTranslated(menu, "0", "%t: %t", "Head Model", g_bHideHeadModels[client] ? "Disabled" : "Enabled");
|
AddMenuItemTranslated(menu, "0", "%t: %t", "Crown", g_bHideCrown[client] ? "Disabled" : "Enabled");
|
||||||
AddMenuItemTranslated(menu, "1", "%t: %t", "Dialog", g_bHideDialog[client] ? "Disabled" : "Enabled");
|
AddMenuItemTranslated(menu, "1", "%t: %t", "Dialog", g_bHideDialog[client] ? "Disabled" : "Enabled");
|
||||||
AddMenuItemTranslated(menu, "2", "%t: %t", "Immunity", g_bProtection[client] ? "Disabled" : "Enabled");
|
AddMenuItemTranslated(menu, "2", "%t: %t", "Immunity", g_bProtection[client] ? "Disabled" : "Enabled");
|
||||||
|
|
||||||
@ -206,7 +205,7 @@ public int MenuHandler_MainMenu(Menu menu, MenuAction action, int client, int se
|
|||||||
{
|
{
|
||||||
switch(selection)
|
switch(selection)
|
||||||
{
|
{
|
||||||
case(0): ToggleHeadModels(client);
|
case(0): ToggleCrown(client);
|
||||||
case(1): ToggleDialog(client);
|
case(1): ToggleDialog(client);
|
||||||
case(2): ToggleImmunity(client);
|
case(2): ToggleImmunity(client);
|
||||||
}
|
}
|
||||||
@ -266,12 +265,12 @@ public void OnMapStart()
|
|||||||
public void OnClientCookiesCached(int client)
|
public void OnClientCookiesCached(int client)
|
||||||
{
|
{
|
||||||
char sBuffer[4];
|
char sBuffer[4];
|
||||||
GetClientCookie(client, g_hCookie_HideHeadModels, sBuffer, sizeof(sBuffer));
|
GetClientCookie(client, g_hCookie_HideCrown, sBuffer, sizeof(sBuffer));
|
||||||
|
|
||||||
if (sBuffer[0])
|
if (sBuffer[0])
|
||||||
g_bHideHeadModels[client] = true;
|
g_bHideCrown[client] = true;
|
||||||
else
|
else
|
||||||
g_bHideHeadModels[client] = false;
|
g_bHideCrown[client] = false;
|
||||||
|
|
||||||
GetClientCookie(client, g_hCookie_HideDialog, sBuffer, sizeof(sBuffer));
|
GetClientCookie(client, g_hCookie_HideDialog, sBuffer, sizeof(sBuffer));
|
||||||
|
|
||||||
@ -298,7 +297,7 @@ public void OnClientDisconnect(int client)
|
|||||||
g_iPlayerDamageFrom1K[client] = 0;
|
g_iPlayerDamageFrom1K[client] = 0;
|
||||||
g_iPlayerInfections[client] = 0;
|
g_iPlayerInfections[client] = 0;
|
||||||
|
|
||||||
g_bHideHeadModels[client] = false;
|
g_bHideCrown[client] = false;
|
||||||
g_bHideDialog[client] = false;
|
g_bHideDialog[client] = false;
|
||||||
g_bProtection[client] = false;
|
g_bProtection[client] = false;
|
||||||
}
|
}
|
||||||
@ -588,7 +587,7 @@ public void OnClientSpawn(Event hEvent, const char[] sEvent, bool bDontBroadcast
|
|||||||
{
|
{
|
||||||
int client = GetClientOfUserId(hEvent.GetInt("userid"));
|
int client = GetClientOfUserId(hEvent.GetInt("userid"));
|
||||||
|
|
||||||
if (!g_bHideHeadModels[client])
|
if (!g_bHideCrown[client])
|
||||||
{
|
{
|
||||||
if (g_iPlayerWinner[0] == GetSteamAccountID(client))
|
if (g_iPlayerWinner[0] == GetSteamAccountID(client))
|
||||||
{
|
{
|
||||||
|
@ -20,15 +20,15 @@
|
|||||||
{
|
{
|
||||||
"en" "Disabled"
|
"en" "Disabled"
|
||||||
}
|
}
|
||||||
"Head Model"
|
"Crown"
|
||||||
{
|
{
|
||||||
"en" "Crown/Skull"
|
"en" "Crown/Skull"
|
||||||
}
|
}
|
||||||
"Head Models Enabled"
|
"Crown Enabled"
|
||||||
{
|
{
|
||||||
"en" "You will now spawn with a Crown/Skull again."
|
"en" "You will now spawn with a Crown/Skull again."
|
||||||
}
|
}
|
||||||
"Head Models Disabled"
|
"Crown Disabled"
|
||||||
{
|
{
|
||||||
"en" "You will no longer spawn with a Crown/Skull."
|
"en" "You will no longer spawn with a Crown/Skull."
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user