Skip to content

Commit

Permalink
Update to 1.2.2
Browse files Browse the repository at this point in the history
Added support for plugins that provide respawn functionality
  • Loading branch information
Giferns committed Apr 27, 2024
1 parent 5f756a3 commit 55907e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/amxmodx/scripting/include/rt_api.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#endif
#define _rt_api_included

public stock const VERSION[] = "1.2.1";
public stock const VERSION[] = "1.2.2";
public stock const AUTHORS[] = "DEV-CS.RU Community";

/**
Expand Down
9 changes: 9 additions & 0 deletions addons/amxmodx/scripting/rt_core.sma
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public plugin_init() {
RegisterHookChain(RG_CBasePlayer_UseEmpty, "CBasePlayer_UseEmpty_Pre", false);
g_iGetPlayerSpawnSpot_HookChain = RegisterHookChain(RG_CSGameRules_GetPlayerSpawnSpot, "CSGameRules_GetPlayerSpawnSpot_Pre", false);
DisableHookChain(g_iGetPlayerSpawnSpot_HookChain);
RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Pre", .post = 0);

g_eForwards[ReviveStart] = CreateMultiForward("rt_revive_start", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_CELL);
g_eForwards[ReviveLoop_Pre] = CreateMultiForward("rt_revive_loop_pre", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL);
Expand All @@ -66,9 +67,17 @@ public plugin_init() {
g_iPluginLoaded = is_plugin_loaded("rt_planting.amxx", true);
}

public CBasePlayer_Spawn_Pre(id) {
PlayerSpawnOrDisconnect(id);
}

public client_disconnected(id) {
g_flLastUse[id] = 0.0;

PlayerSpawnOrDisconnect(id);
}

PlayerSpawnOrDisconnect(id) {
new iActivator = UTIL_RemoveCorpses(id, DEAD_BODY_CLASSNAME);

if(is_user_connected(iActivator)) {
Expand Down

0 comments on commit 55907e3

Please sign in to comment.