View Single Post
loN
Junior Member
Join Date: Apr 2010
Old 04-18-2010 , 08:18   Re: Admin Models (Updated v1.1.1)
Reply With Quote #4

Hi!

I'm new here, but I have a request too...
Well, I'm not the best at scripting so:

#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
}


The models can not be in "active status" while you wait for the next round, or just restart the actual round.
I think the "register_event" is the problem, so I should make it to "register_spawn", but yeah... I'm not a scripter.
I've took a look at
ConnorMcLeod's Player Models script, it's really amazing but it can not supports the name or IP access, so it's not the best for me...

If anyone can fix this "wait for the next round to see the models" please fix it. I did not want to make a new request, because it already exists but it works badly.
loN is offline