Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new g_SteamIdLocation[]="addons/amxmodx/configs/adminmodel.txt"
new line,text[64],txtlen
new authid[33]
public plugin_init() {
register_plugin("AMX Admin Model", "1.1.1", "whitemike")
register_event("ResetHUD", "resetModel", "b")
register_clcmd("amx_addmodel","addmodel",ADMIN_BAN)
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_model("models/player/admin_ct/admin_ct.mdl")
precache_model("models/player/admin_te/admin_te.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id) {
get_user_authid(id,authid,32)
while((line = read_file(g_SteamIdLocation,line,text,63,txtlen)) != 0) {
if(equali(text,authid)) {
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "admin_te")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "admin_ct")
}
else {
cs_reset_user_model(id)
}
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
public addmodel(id) {
new arg[50]
read_argv(1,arg,49)
new target=cmd_target(id,arg,9)
get_user_authid(target,authid,32)
new txtformat[50]
format(txtformat,49,"%s",authid)
write_file(g_SteamIdLocation,txtformat,-1)
client_print(id,print_console,"Wrote steamid to the list of AdminModelmab00bers!")
}
I did a little edit job on it. Pretty sure it will work. Place all of your STEAM_ID's in addons/amxmodx/configs/adminmodel.txt
Alternately, I added a command to add them in-game. Meaning no editting the file.