I request this plugin to be unapproved.
Yes it has been downloaded thousand times, but there are some (minor) errors in the code that shouldn't be followed by learning scripters, and also models are hardcoded and that is against forum rules (i know that this plugin should have been released long time before that rule has been made).
Well, the plugin is not unsafe to use but it's a really bad example for learning scripters, and i sometimes see people who link that plugin for people who learn scripting.
Also, there are now few plugins that can do the same job and without hardcoded models.
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() {
register_plugin("AMX Admin Model", "1.1.1", "whitemike")
register_event("ResetHUD", "resetModel", "b") // ResetHUD shouldn't be a place to set models
return PLUGIN_CONTINUE // This return shouldn't exist
}
public plugin_precache() {
precache_model("models/player/admin_ct/admin_ct.mdl") // hardcoded model
precache_model("models/player/admin_te/admin_te.mdl") // hardcoded model
return PLUGIN_CONTINUE // This return shouldn't exist
}
public resetModel(id, level, cid) { // level and cid have no reason to be here, have no effect and may confuse scripters
if (get_user_flags(id) & ADMIN_KICK) {
new CsTeams:userTeam = cs_get_user_team(id) // switch statement would be more appropriated
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id, "admin_te") // hardcoded model
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id, "admin_ct") // hardcoded model
}
else {
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE // again a return with no effect
}
__________________