Raised This Month: $ Target: $400
 0% 

Resetting your name to Steam name does not work


Post New Thread Reply   
 
Thread Tools Display Modes
Peter Brev
Member
Join Date: Aug 2023
Old 09-02-2023 , 14:39   Re: Resetting your name to Steam name does not work
Reply With Quote #11

Quote:
Originally Posted by Grey83 View Post
PHP Code:
public void OnPluginStart()
{
    
RegAdminCmd("sm_reloadcfg"Cmd_ReloadCfgADMFLAG_CONFIG"Reload config");
}

public 
Action Cmd_ReloadCfg(int clientint args)
{
    
ReplyToCommand(client"The configs file will be reloaded");
    
OnMapStart();
    return 
Plugin_Handled;
}

public 
void OnMapStart()
{
    
// reading config

Beautiful! Thanks! I did not realize you could call OnMapStart() like that again.

Quote:
Originally Posted by Grey83 View Post
I think something like that:
PHP Code:
public void OnPluginStart()
{
    
HookEvent("player_changename"Event_PlayerChangenameEventHookMode_Pre);
}

public 
Action Event_PlayerChangename(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    if(!
client || IsFakeClient(client))
        return 
Plugin_Continue;

    return 
Plugin_Changed;    // avoid printing the change to the chat

Apologies. I forgot to mention that I did have similar code. Still, I tried using your version. This works perfectly in games like HL2DM, but it still isn't suppressing the default messages in CSS and TF2. I don't understand why it works in some games and not in others. Searching this on the forums shows something about CSS and TF2 using SayText2 to display the default name change message. I looked at this plugin that suppresses many default messages, including name change messages, but even that plugin doesn't work on my end. I really don't understand what's going on with those 2 games.
Peter Brev is offline
Peter Brev
Member
Join Date: Aug 2023
Old 09-07-2023 , 10:10   Re: Resetting your name to Steam name does not work
Reply With Quote #12

Quote:
Originally Posted by Peter Brev View Post
Additional question: How would I go about preventing a player from changing their name temporarily after an admin used sm_rename on them?
I have tried something, but after testing the following code with a friend, it is not working as I intended it to. I am probably doing it wrong, though. The problem is that if you rename a second player while another one is in cooldown, it takes the time left of the timer applied to the first player and applies it to the second player, which is not what I want. If multiple people get renamed, I want them all to have a unique cooldown timer. This is what I tried so far (I used the default sm_rename code as a base and modified it):

PHP Code:
Handle changename_adminrename_cooldown INVALID_HANDLE;

char g_targetnewname[MAXPLAYERS+1][MAX_NAME_LENGTH];

public 
void OnPluginStart()
{
        
BuildPath(Path_SMadminrenamedfilesizeof(adminrenamedfile), "configs/admin_renamed_temp.ini");

    
changename_adminrename_cooldown CreateConVar("sm_rename_cooldown""60""Controls how long a player needs to wait before changing their name again after an admin renamed them."FCVAR_NOTIFY);

    
RegAdminCmd("sm_rename"Command_RenameADMFLAG_SLAY"Renames a player manually and apply a temporary cooldown before being able to change names again.");
}

public 
void OnMapStart()
{
    for (
int x 0adminrenamedlinesx++)
    {
        
adminrenamedid[x] = "";
    }
    
    
adminrenamedlines 0;

    if (
changename_adminrename_cooldown == INVALID_HANDLE)
    {
        
SetFailState("%s You did not set a valid value for \"sm_rename_cooldown\"."TAG);
    }
}
public 
void OnClientPostAdminCheck(int client)
{
    
char getsteamid[64];

    
RenameCheck(getsteamidclient);
}

public 
bool AdminRenamed()
{
    
Handle file OpenFile(adminrenamedfile"rt");
    if (
file == INVALID_HANDLE)
    {
        
LogError("[NAME] Renamed players file could not be opened."adminrenamedfile);
        if (
GetConVarBool(changename_debug))
        {
            
LogToFile(LOGPATH"%s Renamed players file could not be opened. Check that the file is placed in the \"configs\" folder."LOGTAG);
        }    
        return 
false;
    }
    
    if (
file != INVALID_HANDLE)
    {
        
PrintToServer("[NAME] Successfully loaded admin_renamed_temp.ini"adminrenamedfile);
        if (
GetConVarBool(changename_debug))
        {
            
LogToFile(LOGPATH"%s Renamed players file loaded."LOGTAG);
        }
    }
    
    while(!
IsEndOfFile(file))
    {
        
char line[64];
        
        if (!
ReadFileLine(filelinesizeof(line)))
        {
            break;
        }
        
        
TrimString(line);
        
ReplaceString(line64" """);
        
        if (
strlen(line) == || (line[0] == '/' && line[1] == '/'))
        {
            continue;
        }
        
strcopy(adminrenamedid[adminrenamedlines], sizeof(adminrenamedlines[]), line);
        
adminrenamedlines++;
    }
    
    
CloseHandle(file);
    return 
true;
}

void RenameCheck(char getsteamid[64], char client)
{
    
AdminId clientAdmin GetUserAdmin(client);
    
    if(
GetAdminFlag(clientAdminAdmin_GenericAccess_Effective))
    {
        return;
    }
    
    
ReplaceString(getsteamid64" """);
    
    return;
}

public 
Action adminrenamecheck(Event event, const char[] namebool dontBroadcast)
{
    
char PlayerName[64];
    
GetEventString(event"steamid2"PlayerName64);
    
RenameCheck(PlayerNameGetClientOfUserId(GetEventInt(event"userid")));
    return 
Plugin_Handled;
}

public 
Action Command_Rename(int clientint args)
{
    if (
args 2)
    {
        
PrintToChat(client"%s%s %sUsage: %ssm_rename <#userid|name> <new name>"CTAGTAGCUSAGECLIME);
        return 
Plugin_Handled;
    }
    
    
char arg[MAX_NAME_LENGTH], arg2[MAX_NAME_LENGTH]; 
    
GetCmdArg(1argsizeof(arg));
    
    if (
args 1)
    {
        
GetCmdArg(2arg2sizeof(arg2));
    }
    
    
char target_name[MAX_TARGET_LENGTH];
    
int target_list[MAXPLAYERS], target_count;
    
bool tn_is_ml;
    
    if ((
target_count ProcessTargetString(
            
arg,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_TARGET_NONE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) > 0)
    {
            
        for (
int i 0target_counti++)
        {
            if (
target_count 1)  // getting rid of that dumb randomizer
            
{
                
PrintToChat(client"%s%s %sMore than one player cannot be renamed at a time."CTAGTAGCUSAGE);
                return 
Plugin_Handled;
            }
            
PrintToChatAll("%s%s %s%s %shas been renamed by an admin to %s%s%s."CTAGTAGCPLAYERtarget_nameCUSAGECPLAYERarg2CUSAGE);
            
Format(g_targetnewname[target_list[i]], MAX_NAME_LENGTH"%s"arg2);
            
RenamePlayer(target_list[i]);
            
            if (
GetConVarBool(changename_debug))
            {
                
LogToFile(LOGPATH"%s %s has been renamed by %s to %s."LOGTAGtarget_nameclientarg2);
            }
        }
    }
    else
    {
        
ReplyToTargetError(clienttarget_count);
    }
    
    return 
Plugin_Handled;
}

void RenamePlayer(int target)
{    
    
SetClientName(targetg_targetnewname[target]);
    
g_targetnewname[target][0] = '\0';
    
    
char buffer[32];
    
GetClientAuthId(targetAuthId_Steam2buffersizeof(buffer));
    
    
Handle nfile OpenFile(adminrenamedfile"a+");
    
/*for (int i = 0; i < adminrenamedlines; i++)
    {
        if (StrContains(buffer, adminrenamedid[i], false) != -1)
        {
            return;
        }
    }*/
    
WriteFileLine(nfilebuffer);

    
int timeleft GetConVarInt(changename_adminrename_cooldown);
    
int minssecs;
    if (
timeleft 0)
    {
        
mins timeleft 60;
        
secs timeleft 60;
        
PrintToChat(target"%s%s %sAn admin has renamed you. You have been temporarily banned from changing names for %s%d:%02d%s."CTAGTAGCUSAGECPLAYERminssecsCUSAGE);
        
CheckTimer(target);
    }

    
Handle DP CreateDataPack();
    
WritePackString(DPbuffer);
    
WritePackCell(DPtarget);
    
CreateTimer(GetConVarFloat(changename_adminrename_cooldown), name_temp_banDP);

    
CloseHandle(nfile);
    
OnMapStart();
    if (
GetConVarBool(changename_debug))
    {
        
LogToFile(LOGPATH"%s %s temporarily banned from changing names."LOGTAGtarget);
    }
    return;
        
}

public 
Action name_temp_ban(Handle timerany DP)
{
        
ResetPack(DP);
        
        
char buffer[32];
        
        
ReadPackString(DPbuffer32);

        
CloseHandle(DP);
        
        
PrintToServer("Value of buffer is %s"buffer);
        
ArrayList fileArray CreateArray(32);
        
DeleteFile(adminrenamedfile);
        
File newFile OpenFile(adminrenamedfile"a+");
        
        if (
newFile == null)
        {
            
LogError("%s Could not open admin_renamed_temp.ini"TAG);
            
PrintToServer("%s Could not open admin_renamed_temp.ini"TAG);
            return 
Plugin_Handled;
        }
        
        
PrintToServer("%s %s has been removed from the temporary banned name list."TAGbuffer);
        if (
GetConVarBool(changename_debug))
        {
            
LogToFile(LOGPATH,"%s %s removed from temporary banned names list."TAGbuffer);
        }
        
        for (
int i 0GetArraySize(fileArray); i++)
        {
            
char writeLine[32];
            
fileArray.GetString(iwriteLinesizeof(writeLine));
            
newFile.WriteLine(writeLine);
            if (
GetConVarBool(changename_debug))
            {
                
LogToFile(LOGPATH,"%s %s removed from temporary banned names list."TAGbuffer);
            }
        }
        
delete newFile;
        
delete fileArray;
        
OnMapStart();
        return 
Plugin_Handled;    
    
//PrintToChat(target, "%s%s %sThis name has been added to the banned names list.", CTAG, TAG, CUSAGE);
}

public 
void CheckTimer(int client)
{
    
int iNow GetTime(), iCooldown GetConVarInt(changename_adminrename_cooldown);
    
    if(
iCooldown 0)
    {
        
int iTimeLeft g_iLastUsed[client] + iCooldown iNow;
        
int minssecs;
        if (
iTimeLeft 0)
        {
            
mins iTimeLeft 60;
            
secs iTimeLeft 60;
            
//char timeleftbuffer[128];
            
PrintToChat(client"%s%s %sAn admin recently renamed you. You will only be able to change your name in %s%d:%02d%s."CTAGTAGCUSAGECPLAYERminssecsCUSAGE);
            return;
        }
    }
            
    
g_iLastUsed[client] = iNow;        
    
}

public 
Action Command_Name(int clientint args)
{    
    
gB_HideNameChange true;
    
    
AdminId playerAdmin GetUserAdmin(client);
    
    if (
args == 0)
    {        
        
char id[32], buffer[MAX_NAME_LENGTH], currentname[MAX_NAME_LENGTH];
        
        
GetClientAuthId(clientAuthId_Steam2idsizeof(id));
        
        
g_names.GetString(idbuffersizeof(buffer));
        
        
GetClientName(clientcurrentnamesizeof(currentname));
                
            if(!
GetAdminFlag(playerAdminAdmin_GenericAccess_Effective))
            {
                for (
int z 0adminrenamedlinesz++)
                {                    
                    if (
StrContains(idadminrenamedid[z], false) != -1)
                    {
                        
CheckTimer(client);
                        if (
GetConVarBool(changename_debug))
                        {
                            
LogToFile(LOGPATH"%s %s attempted to change their name, but they have been temporarily suspended from doing so following an admin sm_rename usage."LOGTAGclient);
                        }
                        return 
Plugin_Handled;
                    }
                }
            }
            
            
// Name stuff
    
}

Peter Brev is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 09-07-2023 , 10:49   Re: Resetting your name to Steam name does not work
Reply With Quote #13

PHP Code:
Handle
    hTimer
[MAXPLAYERS+1];
char
    g_targetnewname
[MAXPLAYERS+1][MAX_NAME_LENGTH];

public 
void OnPluginStart()
{
    
BuildPath(Path_SMadminrenamedfilesizeof(adminrenamedfile), "configs/admin_renamed_temp.ini");

    
changename_adminrename_cooldown CreateConVar("sm_rename_cooldown""60""Controls how long a player needs to wait before changing their name again after an admin renamed them."_true);

    
RegAdminCmd("sm_rename"Command_RenameADMFLAG_SLAY"Renames a player manually and apply a temporary cooldown before being able to change names again.");
}

public 
void OnMapStart()
{
    for(
int i 0adminrenamedlinesi++) adminrenamedid[i][0] = 0;
    
adminrenamedlines 0;
}

public 
void OnMapEnd()
{
    for(
int i 1<= MaxClientsi++) hTimer[i] = null;
}

public 
void OnClientPostAdminCheck(int client)
{
    
char getsteamid[64];
    
RenameCheck(getsteamidclient);
}

public 
void OnClientDisconnect(int client)
{
    if(
hTimer[client]) delete hTimer[client];
}

public 
bool AdminRenamed()
{
    
Handle file OpenFile(adminrenamedfile"rt");
    if(!
file)
    {
        
LogError("Renamed players file %s could not be opened."adminrenamedfile);
        if(
GetConVarBool(changename_debug))
        {
            
LogToFile(LOGPATH"%s Renamed players file could not be opened. Check that the file is placed in the \"configs\" folder."LOGTAG);
        }
        return 
false;
    }

    
PrintToServer("[NAME] Successfully loaded %s"adminrenamedfile);
    if(
GetConVarBool(changename_debug)) LogToFile(LOGPATH"%s Renamed players file loaded."LOGTAG);

    
char line[64];
    while(!
IsEndOfFile(file))
    {
        if(!
ReadFileLine(filelinesizeof(line)))
            break;

        
TrimString(line);
        
ReplaceString(linesizeof(line), " """);

        if(!
strlen(line) || (line[0] == '/' && line[1] == '/'))
            continue;

        
strcopy(adminrenamedid[adminrenamedlines], sizeof(adminrenamedlines[]), line);
        
adminrenamedlines++;
    }

    
CloseHandle(file);
    return 
true;
}

void RenameCheck(char getsteamid[64], char client)
{
    
AdminId clientAdmin GetUserAdmin(client);
    if(
clientAdmin != INVALID_ADMIN_ID && GetAdminFlag(clientAdminAdmin_GenericAccess_Effective))
        
ReplaceString(getsteamid64" """);
}

public 
Action adminrenamecheck(Event event, const char[] namebool dontBroadcast)
{
    
char PlayerName[64];
    
GetEventString(event"steamid2"PlayerName64);
    
RenameCheck(PlayerNameGetClientOfUserId(GetEventInt(event"userid")));
    return 
Plugin_Handled;
}

public 
Action Command_Rename(int clientint args)
{
    if(
args 2)
    {
        
PrintToChat(client"%s%s %sUsage: %ssm_rename <#userid|name> <new name>"CTAGTAGCUSAGECLIME);
        return 
Plugin_Handled;
    }

    
char arg[MAX_NAME_LENGTH], arg2[MAX_NAME_LENGTH];
    
GetCmdArg(1argsizeof(arg));
    
GetCmdArg(2arg2sizeof(arg2));

    
char target_name[MAX_TARGET_LENGTH];
    
int target_list[MAXPLAYERS], target_count;
    
bool tn_is_ml;

    if((
target_count ProcessTargetString(
            
arg,
            
client,
            
target_list,
            
MAXPLAYERS,
            
COMMAND_TARGET_NONE,
            
target_name,
            
sizeof(target_name),
            
tn_is_ml)) > 0)
    {

        for(
int itarget_counti++)
        {
            if(
target_count 1)  // getting rid of that dumb randomizer
            
{
                
PrintToChat(client"%s%s %sMore than one player cannot be renamed at a time."CTAGTAGCUSAGE);
                return 
Plugin_Handled;
            }

            
PrintToChatAll("%s%s %s%s %shas been renamed by an admin to %s%s%s."CTAGTAGCPLAYERtarget_nameCUSAGECPLAYERarg2CUSAGE);
            
FormatEx(g_targetnewname[target_list[i]], MAX_NAME_LENGTH"%s"arg2);
            
RenamePlayer(target_list[i]);

            if(
GetConVarBool(changename_debug))
            {
                
LogToFile(LOGPATH"%s %s has been renamed by %s to %s."LOGTAGtarget_nameclientarg2);
            }
        }
    }
    else 
ReplyToTargetError(clienttarget_count);

    return 
Plugin_Handled;
}

void RenamePlayer(int target)
{
    
SetClientName(targetg_targetnewname[target]);
    
g_targetnewname[target][0] = 0;

    
char buffer[32];
    
GetClientAuthId(targetAuthId_Steam2buffersizeof(buffer));

    
Handle nfile OpenFile(adminrenamedfile"a+");
    
/*for(int i; i < adminrenamedlines; i++)
    {
        if(StrContains(buffer, adminrenamedid[i], false) != -1)
        {
            return;
        }
    }*/
    
WriteFileLine(nfilebuffer);
    
CloseHandle(nfile);

    
int timeleft GetConVarInt(changename_adminrename_cooldown);
    
int minssecs;
    if(
timeleft 0)
    {
        
mins timeleft 60;
        
secs timeleft 60;
        
PrintToChat(target"%s%s %sAn admin has renamed you. You have been temporarily banned from changing names for %s%d:%02d%s."CTAGTAGCUSAGECPLAYERminssecsCUSAGE);
        
CheckTimer(target);
    }

    
Handle DP CreateDataPack();
    
WritePackString(DPbuffer);
    
WritePackCell(DPGetClientUserId(target));
    
hTimer[target] = CreateTimer(timeleft 0.0name_temp_banDPTIMER_FLAG_NO_MAPCHANGE|TIMER_DATA_HNDL_CLOSE);

    
OnMapStart();

    if(
GetConVarBool(changename_debug))
    {
        
LogToFile(LOGPATH"%s %s temporarily banned from changing names."LOGTAGtarget);
    }
}

public 
Action name_temp_ban(Handle timerany DP)
{
    
ResetPack(DP);

    
char buffer[32];
    
ReadPackString(DPbuffersizeof(buffer));
    
int target GetClientOfUserId(ReadPackCell(DP));

    
CloseHandle(DP);

    if(!
target)
    {
        return 
Plugin_Stop;
    }

    
PrintToServer("Value of buffer is %s"buffer);

    
ArrayList fileArray CreateArray(32);

    
File newFile OpenFile(adminrenamedfile"a+");
    if(!
newFile)
    {
        
LogError("Could not open %s"adminrenamedfile);
        
PrintToServer("%s Could not open %s"TAGadminrenamedfile);

        
hTimer[target] = null;
        return 
Plugin_Stop;
    }

    
PrintToServer("%s %s has been removed from the temporary banned name list."TAGbuffer);
    if(
GetConVarBool(changename_debug))
    {
        
LogToFile(LOGPATH,"%s removed from temporary banned names list."buffer);
    }

    
char writeLine[32];
    for(
int isize GetArraySize(fileArray); sizei++)    // size of fileArray equals to zero. LOL
    
{
        
fileArray.GetString(iwriteLinesizeof(writeLine));
        
newFile.WriteLine(writeLine);
        if(
GetConVarBool(changename_debug))
        {
            
LogToFile(LOGPATH,"%s removed from temporary banned names list."buffer);
        }
    }
    
delete newFile;
    
delete fileArray;

    
OnMapStart();

    
hTimer[target] = null;
    return 
Plugin_Stop;
    
//PrintToChat(target, "%s%s %sThis name has been added to the banned names list.", CTAG, TAG, CUSAGE);
}

public 
void CheckTimer(int client)
{
    
int iNow GetTime(), iCooldown GetConVarInt(changename_adminrename_cooldown);
    if(
iCooldown 0)
    {
        
int iTimeLeft g_iLastUsed[client] + iCooldown iNow;
        if(
iTimeLeft 0)
        {
            
int mins iTimeLeft 60secs iTimeLeft 60;
            
//char timeleftbuffer[128];
            
PrintToChat(client"%s%s %sAn admin recently renamed you. You will only be able to change your name in %s%d:%02d%s."CTAGTAGCUSAGECPLAYERminssecsCUSAGE);
            return;
        }
    }

    
g_iLastUsed[client] = iNow;

}

public 
Action Command_Name(int clientint args)
{
    
gB_HideNameChange true;

    if(!
args)
    {
        
char id[32], buffer[MAX_NAME_LENGTH], currentname[MAX_NAME_LENGTH];
        
GetClientAuthId(clientAuthId_Steam2idsizeof(id));
        
g_names.GetString(idbuffersizeof(buffer));
        
GetClientName(clientcurrentnamesizeof(currentname));

        
AdminId playerAdmin GetUserAdmin(client);
        if(
playerAdmin == INVALID_ADMIN_ID || !GetAdminFlag(playerAdminAdmin_GenericAccess_Effective))
        {
            for(
int iadminrenamedlinesi++) if(StrContains(idadminrenamedid[i], false) != -1)
            {
                
CheckTimer(client);
                if(
GetConVarBool(changename_debug))
                {
                    
LogToFile(LOGPATH"%s %s attempted to change their name, but they have been temporarily suspended from doing so following an admin sm_rename usage."LOGTAGclient);
                }
                return 
Plugin_Handled;
            }
        }

        
// Name stuff
    
}

I fixed the timer itself, but there are still a lot of things that need to be fixed in the code
__________________
Grey83 is offline
Peter Brev
Member
Join Date: Aug 2023
Old 09-07-2023 , 10:57   Re: Resetting your name to Steam name does not work
Reply With Quote #14

Quote:
Originally Posted by Grey83 View Post
I fixed the timer itself, but there are still a lot of things that need to be fixed in the code
This is absolutely true. Consider me a newbie in this world of writing plugins. I will learn the more I do. I wrote the first version of this plugin back in 2018 when I had absolutely no Sourcemod coding knowledge and this experience taught me a lot. Please, feel free to let me know my mistakes, and how the original code I wrote can be improved in any way, or provide tips for me to remember in the future when making new plugins. I keep your re-write of the entire plugin close by so that I can study it. I appreciate the time you take to respond!

I will take a look at the fixed timer code and report back.
Peter Brev is offline
Peter Brev
Member
Join Date: Aug 2023
Old 09-07-2023 , 17:40   Re: Resetting your name to Steam name does not work
Reply With Quote #15

I tried, ran into error 23 that I cannot seem to fix. That is probably due to my beginner code.
Code:
L 09/07/2023 - 23:33:36: [SM] Plugin "name.smx" encountered error 23: Native detected error
L 09/07/2023 - 23:33:36: [SM] Invalid data handle 9200085 (error 1) passed during timer end with TIMER_DATA_HNDL_CLOSE
L 09/07/2023 - 23:33:36: [SM] Unable to call function "name_temp_ban" due to above error(s).

Last edited by Peter Brev; 09-12-2023 at 17:23.
Peter Brev is offline
Peter Brev
Member
Join Date: Aug 2023
Old 09-16-2023 , 17:15   Re: Resetting your name to Steam name does not work
Reply With Quote #16

Does somebody know how this can be fixed through Sourcemod? https://github.com/ValveSoftware/Sou...mes/issues/263
It is driving me nuts, because none of my attempts worked. Any time I switch teams, my cl_playermodel does not get updated and retains the last model from the opposite team, so any time you use !name (or change your options for that matter since it is not a plugin specific problem), it kills you and switches you back. From what I have been told, it is a one line bug in the C++ code that Valve never fixed. I was told I could hook this function with dhooks, but I honestly have no idea what type of code to type at all.

https://github.com/ValveSoftware/sou...rules.cpp#L759

This is a HL2DM specific issue and does not happen in any other games I tested. Some help would be greatly appreciated in stopping this bug from happening.
Peter Brev is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 09-17-2023 , 03:29   Re: Resetting your name to Steam name does not work
Reply With Quote #17

maybe use this: https://sm.alliedmods.net/new-api/cs...ateClientModel ?
__________________
Grey83 is offline
Peter Brev
Member
Join Date: Aug 2023
Old 09-18-2023 , 17:48   Re: Resetting your name to Steam name does not work
Reply With Quote #18

Quote:
Originally Posted by Grey83 View Post
No dice, sadly. Thank you for the suggestion, though! Here is what I also tried in the meantime: I tried hooking into cl_playermodel, getting the model, storing it into a global variable and forcing it back, tried through OnClientSettingsChanged, tried blocking team changes (while this can work, it does not stop the killing of the player because cl_playermodel is borked). I will keep looking, but HL2DM does not have many players, so it is next to a nonissue. I will implement a fix if/when I have one.

On another note, I have one last request with this plugin. I implemented everything I wanted, but I would like a second set of eyes to see if there are any critical issues that need to be addressed/fixed. In my testing, everything seemed to work fine. Still, I would like a more experienced coder like you Grey to take a look. Again, sorry for the horrendous looking code.

Edit: Removed code, no longer up to date.

Last edited by Peter Brev; 09-20-2023 at 13:12. Reason: Major code re-work
Peter Brev is offline
Peter Brev
Member
Join Date: Aug 2023
Old 09-20-2023 , 13:11   Re: Resetting your name to Steam name does not work
Reply With Quote #19

Quote:
Originally Posted by Grey83 View Post
I fixed the timer itself, but there are still a lot of things that need to be fixed in the code
I ditched having SteamIDs get stored in files after an admin rename. Not sure why I did not think of simply using a global boolean and a timer to set things up. Seems to work better so far.
Peter Brev is offline
Reply


Thread Tools
Display Modes

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 13:45.


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