| Wilson [29th ID] |
06-14-2006 05:06 |
Temporary Command (DoD 1.3)
Hello, I'm trying to create a plugin for Day of Defeat 1.3 that disables player icons while in my server but sets them back to normal when you leave so that it does not happen in other servers.
On the dodplugins.net forum, FURAX44 posted a plugin that would work perfectly, which is listed below. The only problem is it actually edits the client's config.cfg with the command cl_identiconmode 0, and when the client enters any other server even after closing DoD, it is still set to 0. On average I'd say a lot of people don't know the command cl_identiconmode 2 or know they can set it to normal in their options and would simply think their DoD was broken :shock:
Code:
//
// AMX Mod X 1.0 Script
//
// Developed by The AMX Mod X DoD Community
//
// based on EKS ts_scriptblock
// Forum thread: http://forums.alliedmods.net/showthread.php?p=64070
#include <amxmodx>
new g_BlockCheck[33]
new g_BlockIcon
public plugin_init() {
register_plugin("BlockIcon","0.0.1","FURAX44")
register_cvar("block_icon","1")
register_clcmd("block_identiconmode","Used_identiconmode",0,"- Icon Identification is blocked by server")
}
public plugin_cfg()
{
g_BlockIcon = get_cvar_num("block_icon")
}
public client_connect(id){
if (g_BlockIcon==1) BlockIconOnClient(id)
}
stock BlockIconOnClient(id)
{
g_BlockCheck[id] = 1
client_cmd(id,"cl_identiconmode 0;alias cl_identiconmode block_identiconmode")
g_BlockCheck[id] = 0
}
public Used_identiconmode(id){
if (g_BlockCheck[id] == 1) return PLUGIN_CONTINUE
new Name[32]
get_user_name(id,Name,31)
server_print("Client %d %s try to change identiconmode",id,Name)
return PLUGIN_HANDLED
}
My question is: is there any way to temporarily set cl_identiconmode to 0? My thoughts were by making the config.cfg read-only and then executing the command, and diamond-optic from dodplugins.net suggested using the "setinfo" feature of DoD. I tried typing in console, in game: setinfo "cl_identiconmode" "0" -- but it did nothing even after reconnection. It shows up in the "setinfo" list, but doesn't actually do anything, as if it is a passive setting that doesn't execute anything.
How can I solve this?
|