Quote:
Originally Posted by Nican
I made some comments on it:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init() {
register_plugin("AMX Admin Model", "1.1.1", "whitemike")
//On every round start, reset the models
register_event("ResetHUD", "resetModel", "b")
return PLUGIN_CONTINUE
}
public plugin_precache() {
//Precache the models into the server, so players have to download it
precache_model("models/player/admin_ct/admin_ct.mdl")
precache_model("models/player/admin_te/admin_te.mdl")
return PLUGIN_CONTINUE
}
public resetModel(id, level, cid) {
//If user is a admin
if (get_user_flags(id) & ADMIN_KICK) {
//Get user team
new CsTeams:userTeam = cs_get_user_team(id)
//The set_user_model model[] has to be the name of the folder in "models/player"
//Inside the folder has to have the model "with the name of the folder".mdl
//for exemple "admin_te" is in "models/player" and has admin_te.mdl in it
//If him is a T
if (userTeam == CS_TEAM_T) {
//Set his model to player "admin_te"
cs_set_user_model(id, "admin_te")
}
//If him is a CT
else if(userTeam == CS_TEAM_CT) {
//Set his model to player "admin_ct"
cs_set_user_model(id, "admin_ct")
}
else {
//If he is not in any team, reset model
cs_reset_user_model(id)
}
}
return PLUGIN_CONTINUE
}
not sure how the model is not being set on the first round :/
|
Okey, i got it.

But how i can add new models. Admin_ct = GIGN, admin_ownmade2 = SAS, admin_ownmade = GSG
And those are only for ADMINS.
Like this:
PHP Code:
//If him is a CT
else if(userTeam == CS_TEAM_CT) {
//Set his model to player "admin_ct"
cs_set_user_model(id, "admin_ct")
//If him is a CT
else if(userTeam == CS_TEAM_CT) {
//Set his model to player "admin_ownmade"
cs_set_user_model(id, "admin_ownmade")
//If him is a CT
else if(userTeam == CS_TEAM_CT) {
//Set his model to player "admin_ownmade2"
cs_set_user_model(id, "admin_ownmade2")