AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2]Plugin modification / request HELP (https://forums.alliedmods.net/showthread.php?t=318091)

Darkwob 08-13-2019 19:57

[L4D2]Plugin modification / request HELP
 
In" Brutal Hunter Pounce " Plugin:
I want the sm commands to change and the reset command to remain.

for ex:
bhp_penallty chang hunthud
bhp_reset remove

can the distance of each map be written in "tophunters"?
for ex

This map distance : 2600 and just

I just want it to be the distance on the" tophunters " list. so avg, no damage. the name of the lone player, and the numerical value of that distance, whichever distance a survivor has killed.
for ex
Progamer: 2400
Noobgamer: 1850

adding new commands to convars commands

in the brutal hunter pounce add-on, hunter really bounces a lot(forward and up), which doesn't give him pleasure at all in the game. to avoid this, can convars commands be written to the plugin that we can give values for jumping up and down ?
for ex

Convars
brutal_hunter_pounce_upward_distance "650"
brutal_hunter_pounce_forward_distance "1200"
Please help me with a developer who knows the Source software language.
PHP Code:

#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

ConVar bhpDistancebhpMaxAttemptsbhpCoolTimebhpShowDamagebhpShowDistancebhpShowKills,
    
bhpAvgDistancebhpRankTypebhpListMaxbhpListType;

float fDistancefCoolTimefPouncePos[MAXPLAYERS+1][3];
int iMaxAttemptsiRankTypeiListMaxiListTypeiPounces[MAXPLAYERS+1], iPenalty[MAXPLAYERS+1],
    
iListPage[MAXPLAYERS+1] = 1;

Handle hPenaltyTime[MAXPLAYERS+1] = null;
bool bShowDamagebShowDistancebShowKillsbAvgDistancebShowPenalty[MAXPLAYERS+1], bListDone;
char sGame[12], sMap[64];

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
    
GetGameFolderName(sGamesizeof(sGame));
    if (!
StrEqual(sGame"left4dead"false) && !StrEqual(sGame"left4dead2"false))
    {
        
strcopy(errorerr_max"[BHP] Plugin Supports L4D And L4D2 Only!");
        return 
APLRes_SilentFailure;
    }
    
    return 
APLRes_Success;
}

public 
Plugin myinfo =
{
    
name "Brutal Hunter Pounce",
    
author "cravenge",
    
description "Makes Higher Pounces Deadly And Worth Taking.",
    
version "3.12",
    
url ""
};

public 
void OnPluginStart()
{
    
CreateConVar("brutal_hunter_pounce_version""3.12""Brutal Hunter Pounce Version"FCVAR_NOTIFY|FCVAR_SPONLY|FCVAR_DONTRECORD);
    
bhpDistance CreateConVar("brutal_hunter_pounce_distance""1750.0""Distance To Make Deadly Hunter Pounces"FCVAR_NOTIFY|FCVAR_SPONLYtrue1.0);
    
bhpMaxAttempts CreateConVar("brutal_hunter_pounce_max_attempts""2""Maximum Attempts Of Brutal Hunter Pounces"FCVAR_NOTIFY|FCVAR_SPONLY);
    
bhpCoolTime CreateConVar("brutal_hunter_pounce_cool_time""60.0""Cool Time For Every Smashing Hunter Pounce"FCVAR_NOTIFY|FCVAR_SPONLY);
    
bhpShowDamage CreateConVar("brutal_hunter_pounce_show_damage""1""Enable/Disable Damage Display"FCVAR_NOTIFY|FCVAR_SPONLYtrue0.0true1.0);
    
bhpShowDistance CreateConVar("brutal_hunter_pounce_show_distance""1""Enable/Disable Distance Display"FCVAR_NOTIFY|FCVAR_SPONLYtrue0.0true1.0);
    
bhpShowKills CreateConVar("brutal_hunter_pounce_show_kills""1""Enable/Disable Kills Display"FCVAR_NOTIFY|FCVAR_SPONLYtrue0.0true1.0);
    
bhpAvgDistance CreateConVar("brutal_hunter_pounce_avg_distance""1""Enable/Disable Average Distance"FCVAR_NOTIFY|FCVAR_SPONLYtrue0.0true1.0);
    
bhpRankType CreateConVar("brutal_hunter_pounce_rank_type""0""Rank Type: 0=By Kills, 1=By Damage, 2=By Distance"FCVAR_NOTIFY|FCVAR_SPONLYtrue0.0true1.0);
    
bhpListMax CreateConVar("brutal_hunter_pounce_list_max""10""Maximum Number Of Players To List In The Stats"FCVAR_NOTIFY|FCVAR_SPONLYtrue3.0true10.0);
    
bhpListType CreateConVar("brutal_hunter_pounce_list_type""1""Stats Listing Type: 0=All Players, 1=Top Players Only"FCVAR_NOTIFY|FCVAR_SPONLYtrue0.0true1.0);
    
    
fDistance bhpDistance.FloatValue;
    
fCoolTime bhpCoolTime.FloatValue;
    
    
iMaxAttempts bhpMaxAttempts.IntValue;
    
iRankType bhpRankType.IntValue;
    
iListMax bhpListMax.IntValue;
    
iListType bhpListType.IntValue;
    
    
bShowDamage bhpShowDamage.BoolValue;
    
bShowDistance bhpShowDistance.BoolValue;
    
bShowKills bhpShowKills.BoolValue;
    
bAvgDistance bhpAvgDistance.BoolValue;
    
    
bhpDistance.AddChangeHook(OnBHPCVarsChanged);
    
bhpMaxAttempts.AddChangeHook(OnBHPCVarsChanged);
    
bhpCoolTime.AddChangeHook(OnBHPCVarsChanged);
    
bhpShowDamage.AddChangeHook(OnBHPCVarsChanged);
    
bhpShowDistance.AddChangeHook(OnBHPCVarsChanged);
    
bhpShowKills.AddChangeHook(OnBHPCVarsChanged);
    
bhpAvgDistance.AddChangeHook(OnBHPCVarsChanged);
    
bhpRankType.AddChangeHook(OnBHPCVarsChanged);
    
bhpListMax.AddChangeHook(OnBHPCVarsChanged);
    
bhpListType.AddChangeHook(OnBHPCVarsChanged);
    
    
AutoExecConfig(true"brutal_hunter_pounce");
    
    
HookEvent("round_start"OnRoundEvents);
    
HookEvent("round_end"OnRoundEvents);
    
HookEvent("map_transition"OnRoundEvents);
    
    
HookEvent("ability_use"OnAbilityUse);
    
HookEvent("lunge_pounce"OnLungePounce);
    
    
RegConsoleCmd("sm_bhp_penalty"TogglePenalty"Toggles Penalty Notification");
    
RegConsoleCmd("sm_bhp_reset"ResetBHP"Resets Brutal Pounce Count");
    
    
RegConsoleCmd("sm_bhp_list"ListBHP"Displays List Of Brutal Pounces Made");
    
RegConsoleCmd("sm_tophunters"ListBHP"Displays List Of Brutal Pounces Made");
}

public 
void OnBHPCVarsChanged(ConVar cvar, const char[] oldValue, const char[] newValue)
{
    
fDistance bhpDistance.FloatValue;
    
fCoolTime bhpCoolTime.FloatValue;
    
    
iMaxAttempts bhpMaxAttempts.IntValue;
    
iRankType bhpRankType.IntValue;
    
iListMax bhpListMax.IntValue;
    
iListType bhpListType.IntValue;
    
    
bShowDamage bhpShowDamage.BoolValue;
    
bShowDistance bhpShowDistance.BoolValue;
    
bShowKills bhpShowKills.BoolValue;
    
bAvgDistance bhpAvgDistance.BoolValue;
}

public 
Action TogglePenalty(int clientint args)
{
    if (
client == || !IsClientInGame(client))
    {
        return 
Plugin_Handled;
    }
    
    if (
bShowPenalty[client])
    {
        
bShowPenalty[client] = false;
    }
    else
    {
        
bShowPenalty[client] = true;
    }
    
PrintToChat(client"\x04[\x05BHP\x04]\x01 Penalty Notification: \x03%s", (bShowPenalty[client]) ? "On" "Off");
    return 
Plugin_Handled;
}

public 
Action ResetBHP(int clientint args)
{
    if (
client == || !IsClientInGame(client))
    {
        return 
Plugin_Handled;
    }
    
    
AdminId clientId GetUserAdmin(client);
    if (
clientId == INVALID_ADMIN_ID || iPounces[client] == 0)
    {
        
PrintToChat(client"\x04[\x05BHP\x04]\x01 Invalid!");
        return 
Plugin_Handled;
    }
    
    
PrintToChat(client"\x04[\x05BHP\x04]\x01 BHP Counts Reset!");
    if (
hPenaltyTime[client] != null)
    {
        
hPenaltyTime[client] = null;
    }
    
    
iPounces[client] = 0;
    
iPenalty[client] = 0;
    
    return 
Plugin_Handled;
}

public 
Action ListBHP(int clientint args)
{
    if (
client == || !IsClientInGame(client))
    {
        return 
Plugin_Handled;
    }
    
    if (
iListPage[client] != 1)
    {
        
iListPage[client] = 1;
    }
    
BHPStats(client____iListPage[client]);
    
    return 
Plugin_Handled;
}

public 
void OnPluginEnd()
{
    
bhpDistance.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpMaxAttempts.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpCoolTime.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpShowDamage.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpShowDistance.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpShowKills.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpAvgDistance.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpRankType.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpListMax.RemoveChangeHook(OnBHPCVarsChanged);
    
bhpListType.RemoveChangeHook(OnBHPCVarsChanged);
    
    
delete bhpDistance;
    
delete bhpMaxAttempts;
    
delete bhpCoolTime;
    
delete bhpShowDamage;
    
delete bhpShowDistance;
    
delete bhpShowKills;
    
delete bhpAvgDistance;
    
delete bhpRankType;
    
delete bhpListMax;
    
delete bhpListType;
    
    
UnhookEvent("round_start"OnRoundEvents);
    
UnhookEvent("round_end"OnRoundEvents);
    
UnhookEvent("map_transition"OnRoundEvents);
    
    
UnhookEvent("ability_use"OnAbilityUse);
    
UnhookEvent("lunge_pounce"OnLungePounce);
}

public 
void OnMapStart()
{
    
GetCurrentMap(sMapsizeof(sMap));
}

public 
void OnRoundEvents(Event event, const char[] namebool dontBroadcast)
{
    if (
fDistance 1.0)
    {
        return;
    }
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
iPounces[i] = 0;
            
iPenalty[i] = 0;
            
iListPage[i] = 1;
            
            
bShowPenalty[i] = true;
            
            for (
int i2 0i2 3i2++)
            {
                
fPouncePos[i][i2] = 0.0;
            }
            if (
hPenaltyTime[i] != null)
            {
                if (
StrEqual(sGame"left4dead2"false))
                {
                    
KillTimer(hPenaltyTime[i]);
                }
                
hPenaltyTime[i] = null;
            }
        }
    }
}

public 
void OnAbilityUse(Event event, const char[] namebool dontBroadcast)
{
    if (
fDistance <= 0.0)
    {
        return;
    }
    
    
int user GetClientOfUserId(event.GetInt("userid"));
    if (
user || !IsClientInGame(user) || GetClientTeam(user) != || GetEntProp(userProp_Send"m_zombieClass") != 3)
    {
        return;
    }
    
    
char sAbility[24];
    
event.GetString("ability"sAbility24);
    if (
StrEqual(sAbility"ability_lunge"false))
    {
        if (
iPounces[user] <= iMaxAttempts)
        {
            
GetClientAbsOrigin(userfPouncePos[user]);
        }
        
        if (!
IsFakeClient(user))
        {
            
CreateTimer(0.1MakeFartherPounceuser);
        }
    }
}

public 
Action MakeFartherPounce(Handle timerany client)
{
    
KillTimer(timer);
    if (!
IsServerProcessing())
    {
        return 
Plugin_Stop;
    }
    
    
float fVelocity[3];
    
GetEntPropVector(clientProp_Data"m_vecVelocity"fVelocity);
    
    
fVelocity[0] *= 1.6;
    
fVelocity[1] *= 1.6;
    
fVelocity[2] *= 1.8;
    
    
TeleportEntity(clientNULL_VECTORNULL_VECTORfVelocity);
    return 
Plugin_Stop;
}

public 
void OnLungePounce(Event event, const char[] namebool dontBroadcast)
{
    if (
fDistance 1.0)
    {
        return;
    }
    
    
int pouncer GetClientOfUserId(event.GetInt("userid"));
    if (
pouncer || pouncer MaxClients || !IsClientInGame(pouncer) || GetClientTeam(pouncer) != || GetEntProp(pouncerProp_Send"m_zombieClass") != 3)
    {
        return;
    }
    
    
int pounced GetClientOfUserId(event.GetInt("victim"));
    if (
pounced || pounced MaxClients || !IsClientInGame(pounced) || GetClientTeam(pounced) != 2)
    {
        return;
    }
    
    
float fLandedPos[3];
    
GetClientAbsOrigin(pouncerfLandedPos);
    
    if (
GetVectorDistance(fPouncePos[pouncer], fLandedPos) < fDistance)
    {
        
PrintToChat(pouncer"\x04[\x05BHP\x04]\x01 Failed! \x05(\x04%.1f\x05 / \x04%.1f\x05)"GetVectorDistance(fPouncePos[pouncer], fLandedPos), fDistance);
        return;
    }
    
    if (
iPounces[pouncer] > iMaxAttempts)
    {
        
PrintToChat(pouncer"\x04[\x05BHP\x04]\x01 Maximum Limits Reached!%s", (GetUserAdmin(pouncer) == INVALID_ADMIN_ID) ? "" " Type \x04!bhp_reset\x01 To Reset Your BHP!");
        return;
    }
    
    if (
iPenalty[pouncer] > 0)
    {
        if (!
bShowPenalty[pouncer])
        {
            
PrintToChat(pouncer"\x04[\x05BHP\x04]\x01 Please Wait!");
        }
        return;
    }
    
    
int iDmg = (GetEntProp(pouncedProp_Send"m_isIncapacitated"1)) ? GetClientHealth(pounced) : (GetClientHealth(pounced) + FindConVar("survivor_incap_health").IntValue);
    
BHPStats(pouncer1iDmgRoundFloat(GetVectorDistance(fPouncePos[pouncer], fLandedPos)), true);
    
    
Event ePlayerHurt CreateEvent("player_hurt"true);
    
ePlayerHurt.SetInt("userid"GetClientUserId(pounced));
    
ePlayerHurt.SetInt("attacker"GetClientUserId(pouncer));
    
ePlayerHurt.SetString("weapon""hunter_claw");
    
ePlayerHurt.SetInt("dmg_health"iDmg);
    
ePlayerHurt.Fire();
    
    if (!
GetEntProp(pouncedProp_Send"m_isIncapacitated"1) && GetEntProp(pouncedProp_Send"m_currentReviveCount") < FindConVar("survivor_max_incapacitated_count").IntValue)
    {
        
Event ePlayerIncapacitated CreateEvent("player_incapacitated"true);
        
ePlayerIncapacitated.SetInt("userid"GetClientUserId(pounced));
        
ePlayerIncapacitated.SetInt("attacker"GetClientUserId(pouncer));
        
ePlayerIncapacitated.SetString("weapon""hunter_claw");
        
ePlayerIncapacitated.Fire();
    }
    
ForcePlayerSuicide(pounced);
    
    
Event ePlayerDeath CreateEvent("player_death"true);
    
ePlayerDeath.SetInt("userid"GetClientUserId(pounced));
    
ePlayerDeath.SetInt("attacker"GetClientUserId(pouncer));
    
ePlayerDeath.SetString("weapon""hunter_claw");
    
ePlayerDeath.Fire();
    
    
iPounces[pouncer] += 1;
    
PrintToChat(pouncer"\x04[\x05BHP\x04]\x01 Attempts: \x04%d\x01 / \x04%i"iPounces[pouncer], iMaxAttempts 1);
    
    if (
bShowDamage && bShowDistance)
    {
        
PrintToChatAll("\x04[\x05BHP\x04] \x03%N\x01 Brutally Pounced \x03%N\x01! \x05[%.2f Units / %i Dmg]"pouncerpouncedGetVectorDistance(fPouncePos[pouncer], fLandedPos), iDmg);
    }
    else if (
bShowDamage)
    {
        
PrintToChatAll("\x04[\x05BHP\x04] \x03%N\x01 Brutally Pounced \x03%N\x01! \x05[%i Dmg]"pouncerpouncediDmg);
    }
    else if (
bShowDistance)
    {
        
PrintToChatAll("\x04[\x05BHP\x04] \x03%N\x01 Brutally Pounced \x03%N\x01! \x05[%.2f Units]"pouncerpouncedGetVectorDistance(fPouncePos[pouncer], fLandedPos));
    }
    else
    {
        
PrintToChatAll("\x04[\x05BHP\x04] \x03%N\x01 Brutally Pounced \x03%N\x01!"pouncerpounced);
    }
    
    if (
hPenaltyTime[pouncer] == null)
    {
        
iPenalty[pouncer] = RoundToNearest(fCoolTime iPounces[pouncer]);
        
hPenaltyTime[pouncer] = CreateTimer(1.0ShowNextBPpouncerTIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT);
    }
}

public 
Action ShowNextBP(Handle timerany client)
{
    if (!
IsClientInGame(client))
    {
        if (
hPenaltyTime[client] != null)
        {
            if (
StrEqual(sGame"left4dead2"false))
            {
                
KillTimer(hPenaltyTime[client]);
            }
            
hPenaltyTime[client] = null;
        }
        return 
Plugin_Stop;
    }
    
    if (
hPenaltyTime[client] == null)
    {
        return 
Plugin_Stop;
    }
    
    if (
iPenalty[client] < 1)
    {
        
PrintToChat(client"\x04[\x05BHP\x04]\x01 You Can Brutal Pounce Again!");
        
        if (
hPenaltyTime[client] != null)
        {
            if (
StrEqual(sGame"left4dead2"false))
            {
                
KillTimer(hPenaltyTime[client]);
            }
            
hPenaltyTime[client] = null;
        }
        return 
Plugin_Stop;
    }
    
    if (
bShowPenalty[client])
    {
        
PrintHintText(client"%d %s Before Next Brutal Pounce!\nType !bhp_penalty To Toggle This Notification!"iPenalty[client], (iPenalty[client] == 1) ? "Second" "Seconds");
    }
    
iPenalty[client] -= 1;
    return 
Plugin_Continue;
}

void BHPStats(int clientint iKill 0int iDamage 0int iDistance 0bool bUpdate falseint iPage 1)
{
    
char sRequirePath[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMsRequirePathsizeof(sRequirePath), "data/bhpstats");
    if (!
DirExists(sRequirePath))
    {
        
CreateDirectory(sRequirePathFPERM_O_READ|FPERM_O_WRITE|FPERM_O_EXEC);
    }
    
    
BuildPath(Path_SMsRequirePathsizeof(sRequirePath), "data/bhpstats/%s.txt"sMap);
    
KeyValues kvStats = new KeyValues("bhpstats");
    
    if (!
bUpdate)
    {
        if (!
kvStats.ImportFromFile(sRequirePath))
        {
            
PrintToChat(client"\x04[\x05BHP\x04]\x01 No Saved Data!");
            
delete kvStats;
            
            return;
        }
        
        
kvStats.JumpToKey("pouncers");
        
int iTotal kvStats.GetNum("total"0);
        
        
decl String:bhpNames[iTotal][MAX_NAME_LENGTH];
        new 
bhpRecord[iTotal][4];
        
        
kvStats.GoBack();
        
kvStats.JumpToKey("records");
        
kvStats.GotoFirstSubKey();
        
        for (
int i 0iTotali++)
        {
            
kvStats.GetString("name"bhpNames[i], MAX_NAME_LENGTH"Unknown Player");
            
            
bhpRecord[i][0] = i;
            
bhpRecord[i][1] = kvStats.GetNum("kills"0);
            
bhpRecord[i][2] = kvStats.GetNum("dmg"0);
            
bhpRecord[i][3] = kvStats.GetNum("dist"0);
            
            
kvStats.GotoNextKey();
        }
        
        
SortCustom2D(bhpRecordiTotalBPRankSort);
        
        
Panel pStats = new Panel();
        
        
char sTitle[128];
        
Format(sTitlesizeof(sTitle), "BHP Stats: (%s)"sMap);
        
pStats.SetTitle(sTitle);
        
        
pStats.DrawText(" \n");
        
        
char sTextList[128];
        for (
int i = (iListType == && iPage 1) ? iListMax iPage 0iTotali++)
        {
            if (
bShowKills)
            {
                if (
bShowDamage && bShowDistance)
                {
                    if (
== 0)
                    {
                        if (
bAvgDistance)
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Kills  |  Damage  |  Avg. Distance");
                        }
                        else
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Kills  |  Damage  |  Distance");
                        }
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d | %d | %d"1bhpNames[bhpRecord[i][0]], bhpRecord[i][1], bhpRecord[i][2], bhpRecord[i][3]);
                }
                else if (
bShowDamage)
                {
                    if (
== 0)
                    {
                        
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Kills  |  Damage");
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d | %d"i+1bhpNames[bhpRecord[i][0]], bhpRecord[i][1], bhpRecord[i][2]);
                }
                else if (
bShowDistance)
                {
                    if (
== 0)
                    {
                        if (
bAvgDistance)
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Kills  |  Avg. Distance");
                        }
                        else
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Kills  |  Distance");
                        }
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d | %d"i+1bhpNames[bhpRecord[i][0]], bhpRecord[i][1], bhpRecord[i][3]);
                }
                else
                {
                    if (
== 0)
                    {
                        
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Kills");
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d"1bhpNames[bhpRecord[i][0]], bhpRecord[i][1]);
                }
            }
            else
            {
                if (
bShowDamage && bShowDistance)
                {
                    if (
== 0)
                    {
                        if (!
bAvgDistance)
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Damage  |  Distance");
                        }
                        else
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Damage  |  Avg. Distance");
                        }
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d | %d"1bhpNames[bhpRecord[i][0]], bhpRecord[i][2], bhpRecord[i][3]);
                }
                else if (
bShowDamage)
                {
                    if (
== 0)
                    {
                        
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Damage");
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d"1bhpNames[bhpRecord[i][0]], bhpRecord[i][2]);
                }
                else if (
bShowDistance)
                {
                    if (
== 0)
                    {
                        if (!
bAvgDistance)
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Distance");
                        }
                        else
                        {
                            
strcopy(sTextListsizeof(sTextList), "No.    Name    -  Avg. Distance");
                        }
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s - %d"1bhpNames[bhpRecord[i][0]], bhpRecord[i][3]);
                }
                else
                {
                    if (
== 0)
                    {
                        
strcopy(sTextListsizeof(sTextList), "No.    Name    ");
                        
pStats.DrawText(sTextList);
                    }
                    
Format(sTextListsizeof(sTextList), "%i. %s"1bhpNames[bhpRecord[i][0]]);
                }
            }
            
pStats.DrawText(sTextList);
            
            if (
>= (iListMax iPage) - || >= iTotal)
            {
                
pStats.DrawText(" \n");
                
                if (
iListType != 1)
                {
                    if (
iPage 1)
                    {
                        
pStats.DrawItem("Back");
                    }
                    
                    if (
iListMax iTotal)
                    {
                        
pStats.DrawItem("Next");
                    }
                    
pStats.DrawText(" \n");
                }
                
                break;
            }
        }
        
        
Format(sTextListsizeof(sTextList), "%d Brutal %s Recorded On This Map!"iTotal, (iTotal 1) ? "Pouncers" "Pouncer");
        
pStats.DrawText(sTextList);
        
        
pStats.Send(clientpStatsHandler20);
        
delete pStats;
    }
    else
    {
        
char sFileVersion[16];
        
kvStats.GetString("Version"sFileVersionsizeof(sFileVersion), "0.0");
        if (
FileExists(sRequirePath) && !StrEqual(sFileVersion"3.12"false))
        {
            
DeleteFile(sRequirePath);
        }
        
        
char sName[MAX_NAME_LENGTH], sSteamID[32];
        
int iTotaliTotalKilliTotalDmgiTotalDist;
        
        
GetClientName(clientsNamesizeof(sName));
        
GetClientAuthString(clientsSteamIDsizeof(sSteamID));
        
        
kvStats.ImportFromFile(sRequirePath);
        
kvStats.SetString("version""3.12");
        
kvStats.JumpToKey("records"true);
        
        if (!
kvStats.JumpToKey(sSteamID))
        {
            
kvStats.GoBack();
            
kvStats.JumpToKey("pouncers"true);
            
            
iTotal kvStats.GetNum("total"0);
            
iTotal += 1;
            
            
kvStats.SetNum("total"iTotal);
            
kvStats.GoBack();
            
            
kvStats.JumpToKey("records");
            
kvStats.JumpToKey(sSteamIDtrue);
        }
        
        
kvStats.SetString("name"sName);
        
        
iTotalKill kvStats.GetNum("kills"0);
        
iTotalKill += 1;
        
        
kvStats.SetNum("kills"iTotalKill);
        
        
iTotalDmg kvStats.GetNum("dmg"0);
        
iTotalDmg += iDamage;
        
        
kvStats.SetNum("dmg"iTotalDmg);
        
        
iTotalDist kvStats.GetNum("dist"0);
        
iTotalDist += iDistance;
        
        if (
bAvgDistance)
        {
            
kvStats.SetNum("dist"RoundFloat(float(iTotalDist) / float(iTotalKill)));
        }
        else
        {
            
kvStats.SetNum("dist"iTotalDist);
        }
        
        
kvStats.Rewind();
        
kvStats.ExportToFile(sRequirePath);
    }
    
    
delete kvStats;
}

public 
int BPRankSort(int[] array1int[] array2, const int[][] completeArrayHandle hndl)
{
    if (
array1[iRankType+1] > array2[iRankType+1])
    {
        return -
1;
    }
    
    if (
array1[iRankType+1] == array2[iRankType+1])
    {
        return 
0;
    }
    
    return 
1;
}

public 
int pStatsHandler(Menu menuMenuAction actionint param1int param2)
{
    if (
action == MenuAction_Select && iListType != 0)
    {
        if (
param1 && param1 <= MaxClients && IsClientInGame(param1))
        {
            
iListPage[param1] += (param2 == 1) ? : (-1);
            
BHPStats(param1____iListPage[param1]);
        }
    }


VİDEO LİNK
https://www.youtube.com/watch?v=dhPndWnqYWQ&t=127s

Brutal Hunter Pounce Sp files


All times are GMT -4. The time now is 12:52.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.