AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [TF2] Auto Renaming with SteamID? (https://forums.alliedmods.net/showthread.php?t=249817)

Marverlous 10-12-2014 17:01

[TF2] Auto Renaming with SteamID?
 
Hello y'all! Would anyone be kind enough to craft a plugin that automatically rename a player with specific SteamID? It's like "Custom Chat Color" but instead of tag/name color, it rename the player. Thanks for reading this, you have my gratitude.

Arkarr 10-13-2014 04:33

Re: [TF2] Auto Renaming with SteamID?
 
Not tested.
Donate if you like my plugin :3

EDIT: Do not use.

Marverlous 10-13-2014 18:30

Re: [TF2] Auto Renaming with SteamID?
 
You're awesome! Sorry for not being clear enough, I mean renaming based on their steamid. For example if you enter
Quote:

"Steamid xxxy" "Mr. Meow"
in a config, everytime a person with Steamid "Steamid xxxy" join the server, it automatically rename them to "Mr. Meow"

You're the best, I would donate if I could, at the moment all I have to offer is my gratitude and the knowledge that you have a special place in my heart.

Arkarr 10-13-2014 19:26

Re: [TF2] Auto Renaming with SteamID?
 
Erf, first, thanks and second... Well, I'm kinda tired right now, will do this tomorrow.

Arkarr 10-14-2014 06:11

Re: [TF2] Auto Renaming with SteamID?
 
Here, updated ! Do not forget to check the config file ! (sourcemod/configs/steamid_renamer.txt)
To install, simply extract the zip archive into your sourcemod folder.

EDIT: Do not use.

Marverlous 10-14-2014 19:08

Re: [TF2] Auto Renaming with SteamID?
 
Wonderful, will test it right away!

Marverlous 10-15-2014 22:43

Re: [TF2] Auto Renaming with SteamID?
 
Worked flawlessly. It broke "Custom Chat Color" 's name color feature, though. How would I fix this?

Arkarr 10-16-2014 04:40

Re: [TF2] Auto Renaming with SteamID?
 
Quote:

Originally Posted by Marverlous (Post 2211585)
Worked flawlessly. It broke "Custom Chat Color" 's name color feature, though. How would I fix this?

Really hum... I have to edit Custom Chat Color, I guess. Someone can confirm this ?

Dr. Greg House 10-16-2014 17:28

Re: [TF2] Auto Renaming with SteamID?
 
Code:

new Handle:Array_SteamIDName = INVALID_HANDLE;
Kv? Enum hack? Anyone?

Code:

public Action:Timer_Rename(Handle:timer, any:client)
{
    RenamePlayer(client);
    return Plugin_Stop;
}

[...]

CreateTimer(0.5, Timer_Rename, client, TIMER_FLAG_NO_MAPCHANGE);

Wow.

Code:

    new Handle:fileHandle=OpenFile(path,"r");
    while(!IsEndOfFile(fileHandle)&&ReadFileLine(fileHandle,line,sizeof(line)))
    {

Wow.

Code:

        ExplodeString(line, "->", steamid_name, sizeof steamid_name, sizeof steamid_name[]);
        PushArrayString(Array_SteamIDName, steamid_name[0]);
        PushArrayString(Array_SteamIDName, steamid_name[1]);

wtf. See first comment. Also 0 verification.

Code:

    GetClientAuthString(client, steam_id, sizeof(steam_id));
Wow.

Code:

    new index = FindStringInArray(Array_SteamIDName, steam_id);
    if(index != -1)
    {
        decl String:new_name[100];
        GetArrayString(Array_SteamIDName, index+1, new_name, sizeof(new_name));
        SetClientInfo(client, "name", new_name);
    }
}

See wtf from earlier.


Please do not use this.

Arkarr 10-17-2014 03:37

Re: [TF2] Auto Renaming with SteamID?
 
Yeah, well, I thought it would be better to use a simple text file to do this, but apparently, it was a bad idea also, all those small piece of code as been found here and here and I thought there was 0 problem using them...

And what's wrong with this ?

Quote:

Originally Posted by Dr. Greg House (Post 2211907)
Wow.

Code:

    new index = FindStringInArray(Array_SteamIDName, steam_id);
    if(index != -1)
    {
        decl String:new_name[100];
        GetArrayString(Array_SteamIDName, index+1, new_name, sizeof(new_name));
        SetClientInfo(client, "name", new_name);
    }
}


See wtf from earlier.


All times are GMT -4. The time now is 03:26.

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