- Auto Change Bot Name
Change all bot name to whatever i want, i dont mind if setting in cvar or cfg
example:
sm_botname1: Tesla
sm_botname2: Axis
sm_botname3: Apollo
.... etc
make sure this plugin support duplicate default name, like Ellis, (1)Ellis, (2)Ellis
- Kill Announce
print to chat when survivor get killed by infected, example: [infected player name] just killed [survivor bot names]
make sure this plugin support with Auto change Bot Name above
- Charger Fast Pound
If not wrong, charger pound default damage is 15... so in this plugin, the charger has fast pound and change damage to what i want
example:
sm_charger_pound_duration: 0.5 (0.5 second)
sm_charger_pound_damage: 2
I know this plugin exist, I played at random modded server a while ago and i saw there charger has faster pound
Maybe someone can fix this - on the "Auto Change Bot Name" request I got as far as this but it looks like it won't change the client's name. I verified the check right before the attempted name change gets fired (if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp)))) with the correct string value (e.g. "Ellis" "tesla").
Was going to do some more work to get this working and optimize the code a bit but lost interest.
Spoiler
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
StringMap g_hTrie_botnames;
public Plugin myinfo = {
name = "Bot name changer",
author = "dustin",
description = "",
version = "1.0",
url = "https://forums.alliedmods.net/showthread.php?t=317598"
};
public void OnPluginStart()
{
g_hTrie_botnames = CreateTrie();
}
public void OnClientPostAdminCheck(int client)
{
// client's name isn't available immediately if it's a fake client for some reason
if (0 < client && IsClientInGame(client) && IsFakeClient(client))
{
CreateTimer(3.0, Timer_NameCheck, GetClientUserId(client));
}
}
public Action Timer_NameCheck(Handle timer, any data)
{
int client = GetClientOfUserId(data);
// check to see if the name exists in the string map.
if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp)))
{
//SetClientName(client, sTmp); // not working on fake clients
SetClientInfo(client, "name", sTmp);
SetEntPropString(client, Prop_Data, "m_szNetname", sTmp);
Maybe someone can fix this - on the "Auto Change Bot Name" request I got as far as this but it looks like it won't change the client's name. I verified the check right before the attempted name change gets fired (if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp)))) with the correct string value (e.g. "Ellis" "tesla").
Was going to do some more work to get this working and optimize the code a bit but lost interest.
Spoiler
PHP Code:
#include <sourcemod> #include <sdktools>
#pragma semicolon 1 #pragma newdecls required
StringMap g_hTrie_botnames;
public Plugin myinfo = { name = "Bot name changer", author = "dustin", description = "", version = "1.0", url = "https://forums.alliedmods.net/showthread.php?t=317598" };
public void OnPluginStart() { g_hTrie_botnames = CreateTrie(); }
public void OnClientPostAdminCheck(int client) { // client's name isn't available immediately if it's a fake client for some reason if (0 < client && IsClientInGame(client) && IsFakeClient(client)) { CreateTimer(3.0, Timer_NameCheck, GetClientUserId(client)); } }
public Action Timer_NameCheck(Handle timer, any data) { int client = GetClientOfUserId(data);
// check to see if the name exists in the string map. if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp))) { //SetClientName(client, sTmp); // not working on fake clients SetClientInfo(client, "name", sTmp); SetEntPropString(client, Prop_Data, "m_szNetname", sTmp);
# userid name uniqueid connected ping loss state rate
# 2 1 "ZaviieR Kurumizawa McDowell" STEAM_1:1xxxxxxx 00:24 139 0 active 20000
# 3 "Nick" BOT active
# 4 "Rochelle" BOT active
# 5 "Axis" BOT active
# 6 "tesla" BOT active
#14 "(2)Ellis" BOT active
#13 "(3)Ellis" BOT active
#12 "(4)Ellis" BOT active
#11 "(1)Coach" BOT active
Maybe someone can fix this - on the "Auto Change Bot Name" request I got as far as this but it looks like it won't change the client's name. I verified the check right before the attempted name change gets fired (if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp)))) with the correct string value (e.g. "Ellis" "tesla").
Was going to do some more work to get this working and optimize the code a bit but lost interest.
Spoiler
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
StringMap g_hTrie_botnames;
public Plugin myinfo = {
name = "Bot name changer",
author = "dustin",
description = "",
version = "1.0",
url = "https://forums.alliedmods.net/showthread.php?t=317598"
};
public void OnPluginStart()
{
g_hTrie_botnames = CreateTrie();
}
public void OnClientPostAdminCheck(int client)
{
// client's name isn't available immediately if it's a fake client for some reason
if (0 < client && IsClientInGame(client) && IsFakeClient(client))
{
CreateTimer(3.0, Timer_NameCheck, GetClientUserId(client));
}
}
public Action Timer_NameCheck(Handle timer, any data)
{
int client = GetClientOfUserId(data);
// check to see if the name exists in the string map.
if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp)))
{
//SetClientName(client, sTmp); // not working on fake clients
SetClientInfo(client, "name", sTmp);
SetEntPropString(client, Prop_Data, "m_szNetname", sTmp);
Honestly that plugin wasn't working for me, and the only reason I included manually firing the name changing event in the code is to show I tried that, as well as the 'SetClientName' method.
Manually checking to see if the handle != INVALID_HANDLE before deleting it still doesn't fix the error. Weird. Maybe someone with more experience can post a suggestion.
// only deleting it if it wasn't invalid in the first place.. delete event; }
errors.log
Spoiler
L 07/26/2019 - 17:544: [SM] Exception reported: Handle c4007e is invalid (error 3)
L 07/26/2019 - 17:544: [SM] Blaming: plugin.smx
L 07/26/2019 - 17:544: [SM] Call stack trace:
L 07/26/2019 - 17:544: [SM] [0] CloseHandle
L 07/26/2019 - 17:544: [SM] [1] Line 57, plugin.sp::Timer_NameCheck
edit:
This should work for you I think. For some reason renaming bots on my test server (which only has the default sourcemod plugins installed) doesn't work for me, but since it works for you I think the plugin will work fine without manually firing that name event.
Spoiler
PHP Code:
#include <sourcemod> #include <sdktools>
#pragma semicolon 1 #pragma newdecls required
StringMap g_hTrie_botnames;
public Plugin myinfo = { name = "Bot name changer", author = "dustin", description = "", version = "1.0", url = "https://forums.alliedmods.net/showthread.php?t=317598" };
public void OnPluginStart() { g_hTrie_botnames = CreateTrie(); }
public void OnClientPostAdminCheck(int client) { // client's name isn't available immediately if it's a fake client for some reason if (0 < client && IsClientInGame(client) && IsFakeClient(client)) { CreateTimer(3.0, Timer_NameCheck, GetClientUserId(client)); } }
public Action Timer_NameCheck(Handle timer, any data) { int client = GetClientOfUserId(data);
// check to see if the name exists in the string map. if (GetTrieString(g_hTrie_botnames, sName, sTmp, sizeof(sTmp))) { SetClientInfo(client, "name", sTmp); SetEntPropString(client, Prop_Data, "m_szNetname", sTmp); } }
return Plugin_Handled; }
public void OnConfigsExecuted() { ClearTrie(g_hTrie_botnames);
For some reason my test server doesn't allow renaming bots but does allow for renaming human players so that's odd. Tried the default !rename command that comes with sourcemod and even wrote out a test script to confirm it doesn't work..