I recently downloaded Front Line's Halo Skins plugin that would change the models of each team to a certain player model. I thought that it would be good for my HNS server so I edited it to my own models.
The problem is, when the players connect, the players have to die first before switching to the new models.
Example of the problem is: Player joins T, picks leet class, he is using leet model not new model then he dies, next round he's using new model. Can someone fix this code to not make them need to die first?
I want it in a way that when players connect and join a team, they already have the new model.
PHP Code:
#include <amxmodx>
#include <cstrike>
public plugin_init() {
register_plugin("Halo Skins", "0.5", "Front Line")
register_event("ResetHUD", "resetModel", "b")
return PLUGIN_CONTINUE
}
public plugin_precache() {
precache_model("models/player/hns_t_mm1/hns_t_mm1.mdl")
precache_model("models/player/vip/vip.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (userTeam == CS_TEAM_T) {
cs_set_user_model(id,"hns_t_mm1")
}
else if(userTeam == CS_TEAM_CT) {
cs_set_user_model(id,"vip")
}
else {
cs_reset_user_model(id)
}
return PLUGIN_CONTINUE
}