Permalink
Browse files

Replace OnConfigsExecuted and TTT_OnItemsReset with TTT_OnShopReady

  • Loading branch information...
Bara committed May 20, 2018
1 parent cc48ca7 commit c61f84a8c0852709fccf6c045d498e3b6f329ebb
Showing with 34 additions and 179 deletions.
  1. +1 −7 addons/sourcemod/scripting/include/ttt_shop.inc
  2. +0 −5 addons/sourcemod/scripting/tests/ttt_api_test.sp
  3. +1 −8 addons/sourcemod/scripting/ttt/ttt_blackout.sp
  4. +1 −6 addons/sourcemod/scripting/ttt/ttt_buyRoles.sp
  5. +1 −3 addons/sourcemod/scripting/ttt/ttt_c4_jihad.sp
  6. +1 −4 addons/sourcemod/scripting/ttt/ttt_decoy_body.sp
  7. +1 −3 addons/sourcemod/scripting/ttt/ttt_decoy_teleport.sp
  8. +1 −3 addons/sourcemod/scripting/ttt/ttt_dnascanner.sp
  9. +1 −6 addons/sourcemod/scripting/ttt/ttt_dronescameras.sp
  10. +1 −6 addons/sourcemod/scripting/ttt/ttt_dropWeapons.sp
  11. +1 −3 addons/sourcemod/scripting/ttt/ttt_fakebody.sp
  12. +1 −6 addons/sourcemod/scripting/ttt/ttt_futuristicgrenades.sp
  13. +1 −6 addons/sourcemod/scripting/ttt/ttt_healthshot.sp
  14. +1 −6 addons/sourcemod/scripting/ttt/ttt_iceknife.sp
  15. +1 −6 addons/sourcemod/scripting/ttt/ttt_id.sp
  16. +1 −6 addons/sourcemod/scripting/ttt/ttt_knockout.sp
  17. +1 −6 addons/sourcemod/scripting/ttt/ttt_martydom.sp
  18. +1 −6 addons/sourcemod/scripting/ttt/ttt_nightvision.sp
  19. +1 −6 addons/sourcemod/scripting/ttt/ttt_parachute.sp
  20. +1 −6 addons/sourcemod/scripting/ttt/ttt_poison_smoke.sp
  21. +1 −3 addons/sourcemod/scripting/ttt/ttt_radar.sp
  22. +2 −4 addons/sourcemod/scripting/ttt/ttt_random_teleport.sp
  23. +0 −5 addons/sourcemod/scripting/ttt/ttt_shop.sp
  24. +1 −6 addons/sourcemod/scripting/ttt/ttt_silent_awp.sp
  25. +1 −2 addons/sourcemod/scripting/ttt/ttt_sprint.sp
  26. +1 −6 addons/sourcemod/scripting/ttt/ttt_stations.sp
  27. +1 −6 addons/sourcemod/scripting/ttt/ttt_tactical_shield.sp
  28. +1 −3 addons/sourcemod/scripting/ttt/ttt_tagrenade.sp
  29. +1 −3 addons/sourcemod/scripting/ttt/ttt_taser.sp
  30. +1 −3 addons/sourcemod/scripting/ttt/ttt_teleporter.sp
  31. +1 −6 addons/sourcemod/scripting/ttt/ttt_tracer.sp
  32. +1 −6 addons/sourcemod/scripting/ttt/ttt_tripmines.sp
  33. +1 −6 addons/sourcemod/scripting/ttt/ttt_turret.sp
  34. +1 −6 addons/sourcemod/scripting/ttt/ttt_wallhack.sp
  35. +1 −6 addons/sourcemod/scripting/ttt/ttt_weapons.sp
@@ -12,18 +12,12 @@
*
* @param client The client who purchased the item.
* @param itemshort The short-tag for the item's name.
* @param count TODO
* @param count TODO(?)
*/
forward Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count);
forward Action TTT_OnItemPurchase(int client, int &price, bool &count, const char[] item);
/*
* Called when items array was reset. Useful to re-add all items, unless TTT_OnResetItems doesn't re-add an shop item.
*
*/
forward void TTT_OnItemsReset();
/*
* Called when items array was initialized. This was added to avoid "empty items list".
*
@@ -75,11 +75,6 @@ public void OnConfigsExecuted()
RegisterItem();
}
public void TTT_OnItemsReset()
{
RegisterItem();
}
void RegisterItem()
{
TTT_RegisterCustomItem(PLUGIN_ITEM_SHORT, PLUGIN_ITEM_LONG, PLUGIN_ITEM_PRICE);
@@ -57,14 +57,7 @@ public void OnPluginStart()
HookEvent("round_end", Event_RoundEnd);
}
public void OnConfigsExecuted()
{
SetupBlackout();
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -66,12 +66,7 @@ public void OnPluginStart()
TTT_EndConfig();
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -164,11 +164,9 @@ public void OnConfigsExecuted()
char sBuffer[128];
g_cPlantSeconds.GetString(sBuffer, sizeof(sBuffer));
g_iPlantSecondsCount = ExplodeString(sBuffer, ",", g_sPlantSeconds, sizeof(g_sPlantSeconds), sizeof(g_sPlantSeconds[]));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -89,12 +89,9 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -76,11 +76,9 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -55,11 +55,9 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -66,12 +66,7 @@ public void OnAllPluginsLoaded()
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -89,12 +89,7 @@ public Action OnWeapon(int client, int weapon)
return Plugin_Continue;
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -84,11 +84,9 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -162,12 +162,7 @@ public void OnAllPluginsLoaded()
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -83,12 +83,7 @@ public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadca
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -161,12 +161,7 @@ public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadca
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -122,12 +122,7 @@ public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadca
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -134,12 +134,7 @@ public void OnLibraryRemoved(const char[] name)
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -76,12 +76,7 @@ public void OnClientDisconnect(int client)
g_bHasMartydom[client] = false;
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -45,12 +45,7 @@ public void OnPluginStart()
HookEvent("player_death", Event_PlayerDeath);
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -56,12 +56,7 @@ public void OnAllPluginsLoaded()
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -57,12 +57,7 @@ public void OnPluginStart()
HookEvent("smokegrenade_expired", Event_SmokeExpired);
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -92,11 +92,9 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -88,13 +88,11 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
// LogToFile(g_sLog, "(OnConfigsExecuted) called!");
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
// LogToFile(g_sLog, "(TTT_OnShopReady) called!");
RegisterItem();
}
@@ -65,7 +65,6 @@ Handle g_hOnItemPurchased = null;
Handle g_hOnItemPurchase = null;
Handle g_hOnCreditsGiven_Pre = null;
Handle g_hOnCreditsGiven = null;
Handle g_hOnItemsReset = null;
Handle g_hOnShopReady = null;
Handle g_hReopenCookie = null;
@@ -102,7 +101,6 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
g_hOnItemPurchase = CreateGlobalForward("TTT_OnItemPurchase", ET_Event, Param_Cell, Param_CellByRef, Param_CellByRef, Param_String);
g_hOnCreditsGiven_Pre = CreateGlobalForward("TTT_OnCreditsChanged_Pre", ET_Event, Param_Cell, Param_Cell, Param_CellByRef);
g_hOnCreditsGiven = CreateGlobalForward("TTT_OnCreditsChanged", ET_Ignore, Param_Cell, Param_Cell);
g_hOnItemsReset = CreateGlobalForward("TTT_OnItemsReset", ET_Ignore);
g_hOnShopReady = CreateGlobalForward("TTT_OnShopReady", ET_Ignore);
CreateNative("TTT_RegisterCustomItem", Native_RegisterCustomItem);
@@ -1293,9 +1291,6 @@ public Action Command_SetCredits(int client, int args)
public Action Command_ResetItems(int client, int args)
{
ResetItemsArray("Command_ResetItems", true);
Call_StartForward(g_hOnItemsReset);
Call_Finish();
}
public int Native_GetClientCredits(Handle plugin, int numParams)
@@ -82,12 +82,7 @@ public void OnPluginStart()
AddTempEntHook("Shotgun Shot", Hook_ShotgunShot);
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -71,10 +71,9 @@ public void OnConfigsExecuted()
g_cPluginTag = FindConVar("ttt_plugin_tag");
g_cPluginTag.AddChangeHook(OnConVarChanged);
g_cPluginTag.GetString(g_sPluginTag, sizeof(g_sPluginTag));
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -89,12 +89,7 @@ public void OnMapStart()
PrecacheSoundAny(SND_WARNING, true);
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
@@ -58,12 +58,7 @@ public void OnAllPluginsLoaded()
}
}
public void OnConfigsExecuted()
{
RegisterItem();
}
public void TTT_OnItemsReset()
public void TTT_OnShopReady()
{
RegisterItem();
}
Oops, something went wrong.

0 comments on commit c61f84a

Please sign in to comment.