Skip to content

Commit

Permalink
Bug Fixes + Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Jun 3, 2018
1 parent a4e3521 commit 99ec49b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ deploy:
provider: releases
api_key:
secure: Q4xBL32wClC9pldR/gMwBfMjx5yncC15hxR1OAmb+4LuPc5oGfHSqwD4fSbGUFiOmhgfHaALw9MXFiPm3YueXSprmsJbEBu3zLmqb6LQZA14GFEiwLHXtyoy47Z6mFQ5qQEOX3Iop9s6OlCeJy/Bs3DASv4RC5AOQ5psfWLmqIeS8nNnR9I5L9tt/xBSZrl8EyDPsJJJAegu8U8+j6N/0W1FwAwixRFtKety2O1tB29gS5wU8m/YzZRMo+U9vLDxJdUcY9h6HzBf6NxFGpwCk1sHA254zaroMNtl/WPbwvmz8tOiR+BfRCZ00EsN2NxVh4Kgcp/2+mALKK3GGFnQMO1hABIsgDBqEVRIFVRFwkPq5gcjxk5usgg5RwE3ezSJcESXWqqDhNeiQYz28Y56/1WrSeeD988bnYcJkZcRhGMsuq6S+cxRKieahYbzdNFlhTPp7ydBHT9Yk+roNu7AfrMLAI+NCPkTjr31Me1imNS14+ol+ZPHj5oIGeYUE6C0Rcp2unSdW1ivI2UQRk+5XkumO39Ty/+spTBd2ZrZxEVM3H54EELx+GBzfm/UM4EgEv7wWeNN5UJJ+wozg2QuqI5UCoMjI+fPRaV54XIxdghPYqPFpY1Q19mDGDzwdAdX69QLMi1xQ2QnzB1YAmg6g1xZw1NIAeDGIgn2d7KnxEA=
file: VipBonus.zip
file: HexVips.zip
skip_cleanup: true
on:
branch: master
tags: true
repo: Hexer10/VipMenu-Bonuses
repo: Hexer10/HexVips
14 changes: 8 additions & 6 deletions addons/sourcemod/scripting/hexvips.sp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,17 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int max_err
fOnVipStatusUpdate = CreateGlobalForward("HexVips_VipStatusUpdated", ET_Ignore, Param_Cell, Param_Cell);

#if (VIPMENU != 0)
CreateNative("Vip_ResetItems", Native_ResetItems);

CreateNative("HexVips_ResetItems", Native_ResetItems);
fOnPlayerUseMenu = CreateGlobalForward("HexVip_OnPlayerUseMenu", ET_Ignore, Param_Cell, Param_String);
Menu_AskPluginLoad2();
#endif
bLateLoad = late;
return APLRes_Success;
}



public void OnPluginStart()
{
LoadTranslations("HexVips.phrases");
Expand All @@ -151,7 +154,6 @@ public void OnPluginStart()
//Convars
CreateConVar("hexvips_version", PLUGIN_VERSION, "HexVips Version", FCVAR_NOTIFY | FCVAR_DONTRECORD | FCVAR_SPONLY | FCVAR_REPLICATED);


if (CreateDirectoryEx("cfg/HexVips"))
PrintToServer("Created HexVips cfg directory!");

Expand Down Expand Up @@ -553,7 +555,7 @@ stock bool IsValidTeam(int client, int convar)
*********************************************************************************************************************************/

Action OnBonusSet(int client)
void OnBonusSet(int client)
{
Action res = Plugin_Continue;

Expand All @@ -563,7 +565,7 @@ Action OnBonusSet(int client)

if (res >= Plugin_Handled)
{
return Plugin_Handled;
return;
}

#if (VIPMENU != 0)
Expand All @@ -572,7 +574,7 @@ Action OnBonusSet(int client)

if (bIsMYJBAvaible && cv_bDisableOnEventday.BoolValue)
if (MyJailbreak_IsEventDayRunning())
return Plugin_Handled;
return;

if (cv_iVipSpawnHP.IntValue >= 1 || cv_fVipSpawnArmour.IntValue >= 1)
{
Expand All @@ -583,7 +585,7 @@ Action OnBonusSet(int client)
{
GivePlayerItem(client, "item_defuser");
}
return Plugin_Continue;
return;
}

public int Native_CheckVip(Handle plugin, int argc)
Expand Down
37 changes: 21 additions & 16 deletions addons/sourcemod/scripting/vipmenu.sp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
bool bRegen[MAXPLAYERS + 1] = false;
bool bBhop[MAXPLAYERS + 1] = false;
bool bDoubleJump[MAXPLAYERS + 1] = false;
bool bResetGravity[MAXPLAYERS + 1] = false;
bool bUsed[MAXPLAYERS + 1][13];
/*
0 - Life
Expand Down Expand Up @@ -114,11 +115,6 @@ ConVar cv_fGravity;
ConVar cv_sVipMenuComm;
ConVar cv_sWeapon;

public void Menu_AskPluginLoad2()
{
CreateNative("Vip_ResetItems", Native_ResetItems);
}

public void OnVipMenuStart()
{
RegConsoleCmd("sm_vipmenu", Command_VipMenu, "Open VipMenu for VIPs");
Expand All @@ -128,8 +124,8 @@ public void OnVipMenuStart()
AutoExecConfig_SetCreateFile(true);
cv_bEnableVipMenu = AutoExecConfig_CreateConVar("vip_menu_vipmenu", "1", " 1 - Enable VipMenu. 0 - Disable", 0, true, 0.0, true, 1.0);
cv_sVipMenuComm = AutoExecConfig_CreateConVar("vip_menu_vipmenucmds", "vmenu", "Commands to open the Vipmenu (no need of sm_ or ! or /)(separeted by a comma ',')");
cv_iMenuUse = AutoExecConfig_CreateConVar("vip_menu_uses", "1", "Max VipMenu uses per round", 0, true, 0.0, true, 1.0);
cv_bMenuDoubleUses = AutoExecConfig_CreateConVar("vip_menu_use_once", "1", " 1 - Same item can be used only once. 0 - Same item can be used multiple times");
cv_iMenuUse = AutoExecConfig_CreateConVar("vip_menu_uses", "1", "Max VipMenu uses per round", 0, true, 0.0);
cv_bMenuDoubleUses = AutoExecConfig_CreateConVar("vip_menu_use_once", "1", " 1 - Same item can be used only once. 0 - Same item can be used multiple times", 0, true, 0.0, true, 1.0);
cv_bDisableLR = AutoExecConfig_CreateConVar("vip_menu_disable_lr", "1", "Disable VipMenu in sm_hosties LR", 0, true, 0.0, true, 1.0);
cv_bMenuLife = AutoExecConfig_CreateConVar("vip_menu_life", "1", " 1 - Enable VipMenu Life. 0 - Disable ", 0, true, 0.0, true, 1.0);
cv_iLifeHP = AutoExecConfig_CreateConVar("vip_menu_life_amount", "50", "Amount +HP");
Expand Down Expand Up @@ -190,7 +186,6 @@ public void OnMapStart()
*********************************************************************************************************************************/



public Action Command_ResMenu(int client, int args)
{
if (args == 0)
Expand Down Expand Up @@ -353,11 +348,11 @@ public int hRespawnMenu(Handle menu, MenuAction action, int client, int param2)
}
void vmenu(int client) //MENU
{
Menu menu = CreateMenu(hMenu, MENU_ACTIONS_ALL);
Menu menu = new Menu(hMenu);
Format(sMenuName, sizeof(sMenuName), "%t", "Menu_Title");
menu.SetTitle(sMenuName);

if (cv_bMenuDoubleUses)
if (!cv_bMenuDoubleUses.BoolValue)
{
for (int i = 0; i < sizeof(bUsed[]); i++)
{
Expand Down Expand Up @@ -477,15 +472,16 @@ public int hMenu(Handle menu, MenuAction action, int client, int param2) //MENU
CPrintToChat(client, "%t %t", "Prefix", "Get_Speed");
SetEntitySpeed(client, cv_fSpeed.FloatValue);
iMenuUse[client]++;
bUsed[client][4] = true;
bUsed[client][5] = true;
}
else if (strcmp(info, "Gravity") == 0)
{
Forward_OnPlayerUseMenu(client, info);
CPrintToChat(client, "%t %t", "Prefix", "Get_Gravity");
SetEntityGravity(client, cv_fGravity.FloatValue);
iMenuUse[client]++;
bUsed[client][5] = true;
bResetGravity[client] = true;
bUsed[client][6] = true;
}
else if (strcmp(info, "Regen") == 0)
{
Expand All @@ -499,15 +495,15 @@ public int hMenu(Handle menu, MenuAction action, int client, int param2) //MENU
}
hRegenTimer[client] = CreateTimer(cv_fHpTimer.FloatValue, Timer_Regen, GetClientUserId(client), TIMER_REPEAT);
iMenuUse[client]++;
bUsed[client][6] = true;
bUsed[client][7] = true;
}
else if (strcmp(info, "Bhop") == 0)
{
Forward_OnPlayerUseMenu(client, info);
CPrintToChat(client, "%t %t", "Prefix", "Get_Bhop");
bBhop[client] = true;
iMenuUse[client]++;
bUsed[client][7] = true;
bUsed[client][8] = true;
}

else if (strcmp(info, "Double") == 0)
Expand All @@ -516,14 +512,14 @@ public int hMenu(Handle menu, MenuAction action, int client, int param2) //MENU
CPrintToChat(client, "%t %t", "Prefix", "Get_DoubleJump");
bDoubleJump[client] = true;
iMenuUse[client]++;
bUsed[client][8] = true;
bUsed[client][9] = true;
}

else if (strcmp(info, "NadeKit") == 0)
{
Forward_OnPlayerUseMenu(client, info);
iMenuUse[client]++;
bUsed[client][9] = true;
bUsed[client][4] = true;
if (cv_iNadeMolotov.IntValue != 0)
{
if (GetClientTeam(client) == CS_TEAM_T)
Expand Down Expand Up @@ -617,6 +613,15 @@ public void Menu_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
if (!IsValidClient(client, false, true))
return;

if (bResetGravity[client])
{
SetEntityGravity(client, 1.0);
bResetGravity[client] = false;
}

for (int i = 0; i < sizeof(bUsed[]); i++)
bUsed[i][client] = false;

iMenuUse[client] = 0;
bRegen[client] = false;
bBhop[client] = false;
Expand Down

0 comments on commit 99ec49b

Please sign in to comment.