Raised This Month: $32 Target: $400
 8% 

Can a rank system be made?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 05-07-2021 , 17:41   Can a rank system be made?
Reply With Quote #1

Hi guys, Can I write a plugin that supports the Custom Player Rank Plugin that is currently available and will allow the top 50 or 60 players to write "[RANK-60]Username" in the game?

but there is something like that it will write the username etc in color.
Darkwob is offline
weffer
Member
Join Date: Oct 2020
Old 05-08-2021 , 14:43   Re: Can a rank system be made?
Reply With Quote #2

I remember doing something similar for the top 10 in the ranking but I had to modify the dragokas plugin: https://forums.alliedmods.net/showthread.php?t=320247

PHP Code:
#include <sourcemod>
#include <colors>

#pragma semicolon 1
#define VERSION "1.0"

#undef REQUIRE_PLUGIN
#include <hx_stats>


bool g_bHxStatsAvail;

public 
Plugin myinfo =
{
    
name "Left 4 Dead (2) Color Chat",
    
description "Player Color Chat for Left 4 Dead and Left 4 Dead 2.",
    
author "Weffer",
    
version "1.0",
    
url ""
};

public 
OnPluginStart()
{
    
RegConsoleCmd("say"SayHook);
    
OnAllPluginsLoaded();
}

public 
Action SayHook(int clientint args)
{
    
decl String:Name[MAX_NAME_LENGTH];
    
decl String:Msg[256];
    
    if( !
g_bHxStatsAvail )
    {
        return 
Plugin_Continue;
    }
    
    
int iRank HX_GetRank(clientHX_PLACE);    
    
    if( 
iRank && iRank <= 10 )
    {
        
GetClientName(clientNamesizeof(Name));
        
GetCmdArgString(Msgsizeof(Msg));
        
Msg[strlen(Msg)-1] = '\0';
        
CPrintToChatAll("{green}[{lightgreen}RANK-%i{green}] %s : {default}%s"iRankNameMsg[1]);
        
    }else{
        
GetClientName(clientNamesizeof(Name));
        
GetCmdArgString(Msgsizeof(Msg));
        
Msg[strlen(Msg)-1] = '\0';
        
CPrintToChatAll("{green}%s: {default}%s"NameMsg[1]);
    }
    
    return 
Plugin_Handled;
}

public 
void OnAllPluginsLoaded()
{
    
g_bHxStatsAvail = (GetFeatureStatus(FeatureType_Native"HX_GetRank") == FeatureStatus_Available);

weffer is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 05-10-2021 , 11:20   Re: Can a rank system be made?
Reply With Quote #3

Quote:
Originally Posted by weffer View Post
I remember doing something similar for the top 10 in the ranking but I had to modify the dragokas plugin: https://forums.alliedmods.net/showthread.php?t=320247

PHP Code:
#include <sourcemod>
#include <colors>

#pragma semicolon 1
#define VERSION "1.0"

#undef REQUIRE_PLUGIN
#include <hx_stats>


bool g_bHxStatsAvail;

public 
Plugin myinfo =
{
    
name "Left 4 Dead (2) Color Chat",
    
description "Player Color Chat for Left 4 Dead and Left 4 Dead 2.",
    
author "Weffer",
    
version "1.0",
    
url ""
};

public 
OnPluginStart()
{
    
RegConsoleCmd("say"SayHook);
    
OnAllPluginsLoaded();
}

public 
Action SayHook(int clientint args)
{
    
decl String:Name[MAX_NAME_LENGTH];
    
decl String:Msg[256];
    
    if( !
g_bHxStatsAvail )
    {
        return 
Plugin_Continue;
    }
    
    
int iRank HX_GetRank(clientHX_PLACE);    
    
    if( 
iRank && iRank <= 10 )
    {
        
GetClientName(clientNamesizeof(Name));
        
GetCmdArgString(Msgsizeof(Msg));
        
Msg[strlen(Msg)-1] = '\0';
        
CPrintToChatAll("{green}[{lightgreen}RANK-%i{green}] %s : {default}%s"iRankNameMsg[1]);
        
    }else{
        
GetClientName(clientNamesizeof(Name));
        
GetCmdArgString(Msgsizeof(Msg));
        
Msg[strlen(Msg)-1] = '\0';
        
CPrintToChatAll("{green}%s: {default}%s"NameMsg[1]);
    }
    
    return 
Plugin_Handled;
}

public 
void OnAllPluginsLoaded()
{
    
g_bHxStatsAvail = (GetFeatureStatus(FeatureType_Native"HX_GetRank") == FeatureStatus_Available);

Thank you for answering the position, but unfortunately I do not use this statistics system. Any possibility to adapt this to custom player stats plugin?
// top_rank.sp( : fatal error 183: cannot read from file: "hx_stats"
Darkwob is offline
Balloons
Member
Join Date: Feb 2020
Old 05-25-2021 , 08:06   Re: Can a rank system be made?
Reply With Quote #4

Hello, I'm trying to make a plugin very similar to this Rank Chat prefix thing but I appear to have a conflict with the REGEX Word Filter plugin that I use for moderation purposes https://forums.alliedmods.net/showthread.php?t=71867

By registering the "say" and "say_team" commands to add prefixes on chat messages, it bypasses any filter I have added with the REGEX Word Filter plugin.

Is it possible to make the two plugins work without conflict?

Edit: Nvm I've found a solution by simply adding words and phrases within the Prefix plugin.

PHP Code:
if (client != && (StrEqual(command"say") || StrEqual(command"say_team")))
    {
        
//Filters
        
if (StrEqual(sArgs"/") ||
            
StrEqual(sArgs"bad word") ||
            
StrEqual(sArgs"bad word") ||
            
StrEqual(sArgs"etc"))
        {
            return 
Plugin_Handled;
        } 

Last edited by Balloons; 05-28-2021 at 18:27. Reason: Found solution
Balloons is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:21.


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