AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:S/CS:GO] Multiple players with the same name? (https://forums.alliedmods.net/showthread.php?t=299396)

shavit 07-13-2017 10:23

[CS:S/CS:GO] Multiple players with the same name?
 
Code:

public void OnClientPutInServer(int client)
{
        if(IsClientSourceTV(client))
        {
                return;
        }

        if(!IsFakeClient(client))
        {
                // irrelevant code
        }

        else
        {
                if(!gB_CentralBot)
                {
                        // irrelevant code
                }

                else if(gI_CentralBot == -1)
                {
                        SetClientName(client, "!replay");

                        gI_CentralBot = client;
                }
        }
}

The thing here, is that if someone joins the server with the name "!replay" - one of the clients (the bot or the real player) will have a suffix appended to their name by the game server. How do I make it so the bot doesn't ever get the forced suffix?

8guawong 07-13-2017 11:49

Re: [CS:S/CS:GO] Multiple players with the same name?
 
mabye easier to just rename the player / don't allow those player to connect?
or do bot_join_after_player 0 ?

shavit 07-13-2017 12:06

Re: [CS:S/CS:GO] Multiple players with the same name?
 
Quote:

Originally Posted by 8guawong (Post 2535083)
mabye easier to just rename the player / don't allow those player to connect?
or do bot_join_after_player 0 ?

My bot changes the name during gameplay too, so that's not a solution.

ofir753 07-13-2017 14:53

Re: [CS:S/CS:GO] Multiple players with the same name?
 
Quote:

Originally Posted by shavit (Post 2535085)
My bot changes the name during gameplay too, so that's not a solution.

I dont think you can control the suffix, but im pretty sure you can hook the name changes of the players and kick or block the rename if its !replay or something like that.

If you want multiple bots with the same name you better do something like that, BOT #1 - replay! so it wont suffix.

shavit 07-14-2017 02:48

Re: [CS:S/CS:GO] Multiple players with the same name?
 
Quote:

Originally Posted by ofir753 (Post 2535099)
If you want multiple bots with the same name you better do something like that, BOT #1 - replay! so it wont suffix.

Thanks! Will do as a partial solution, unless someone comes up with a better idea.

BraveFox 07-14-2017 16:57

Re: [CS:S/CS:GO] Multiple players with the same name?
 
You can also check STEAMID, bot's steamid is "BOT"

shavit 07-15-2017 12:29

Re: [CS:S/CS:GO] Multiple players with the same name?
 
Quote:

Originally Posted by BraveFox (Post 2535365)
You can also check STEAMID, bot's steamid is "BOT"

I honestly don't know how is this related to my question.


All times are GMT -4. The time now is 13:00.

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