AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin Models code help (https://forums.alliedmods.net/showthread.php?t=24711)

ltcjohnson 03-01-2006 11:34

Admin Models code help
 
Okay here is what I want to do but don't know how to do it.

I want to change this plugin so certain flags use different models. We have women in our clan and I want to be able to have chick skins for them and male skins for us. What would I need to do to this plugin to get it to work?

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {         register_plugin("AMX Admin Model", "1.1.1", "whitemike")         register_event("ResetHUD", "resetModel", "b")         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, level, cid) {         if (get_user_flags(id) & ADMIN_KICK) {                 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 }

It seems to me that this code here may work.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {         register_plugin("AMX Admin Model", "1.1.1", "whitemike")         register_event("ResetHUD", "resetModel", "b")         return PLUGIN_CONTINUE } public plugin_precache() {         precache_model("models/player/admin_ct/admin_ct.mdl")         precache_model("models/player/admin_te/admin_te.mdl")         precache_model("models/player/admin_te/admin_girl_ct.mdl")         precache_model("models/player/admin_te/admin_girl_te.mdl")         return PLUGIN_CONTINUE } public resetModel(id, level, cid) {         if (get_user_flags(id) & ADMIN_CUSTOMEFLAGA) {                 new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {                         cs_set_user_model(id, "admin_male_te")                 }                 else if(userTeam == CS_TEAM_CT) {                         cs_set_user_model(id, "admin_male_ct")                 }                 else {                         cs_reset_user_model(id)                 }         }                 return PLUGIN_CONTINUE if (get_user_flags(id) & ADMIN_CUSTOMEFLAGB) {                 new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {                         cs_set_user_model(id, "admin_girl_te")                 }                 else if(userTeam == CS_TEAM_CT) {                         cs_set_user_model(id, "admin_girl_ct")                 }                 else {                         cs_reset_user_model(id)                 }         }         return PLUGIN_CONTINUE }

Would that code work? I haven't tried it yet. But will try it tonight. Please let me know. I need all the help I can get :) As for the customeflagA and B what would I need to put?

I want to use these

Code:

; m - custom level A (for additional plugins)
; n - custom level B
; o - custom level C
; p - custom level D
; q - custom level E
; r - custom level F
; s - custom level G
; t - custom level H


[ --<-@ ] Black Rose 03-01-2006 11:47

this would
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("AMX Admin Model", "1.1.1", "whitemike")     register_event("ResetHUD", "resetModel", "b") } public plugin_precache() {     precache_model("models/player/admin_ct/admin_male_ct.mdl")     precache_model("models/player/admin_te/admin_male_te.mdl")     precache_model("models/player/admin_ct/admin_girl_ct.mdl")     precache_model("models/player/admin_te/admin_girl_te.mdl") } public resetModel(id, level, cid) {         if (get_user_flags(id) & ADMIN_LEVEL_A) {                 new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {                         cs_set_user_model(id, "admin_male_te")         }                 else if(userTeam == CS_TEAM_CT) {                         cs_set_user_model(id, "admin_male_ct")         }                 else {             cs_reset_user_model(id)         }     }         if (get_user_flags(id) & ADMIN_LEVEL_B) {                 new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {                         cs_set_user_model(id, "admin_girl_te")         }                 else if(userTeam == CS_TEAM_CT) {                         cs_set_user_model(id, "admin_girl_ct")         }                 else {                         cs_reset_user_model(id)         }     }     return PLUGIN_CONTINUE }

ltcjohnson 03-01-2006 11:51

Thanks for the quick reply. I will try that as soon as I can. Again thank man.

ltcjohnson 03-01-2006 19:37

Okay I compiled the plugin but the it isn't working.

Code:

ADMIN_LEVEL_A
That is this right
Code:

m - custom level A

[ --<-@ ] Black Rose 03-01-2006 19:52

yes

ltcjohnson 03-01-2006 22:08

Okay. It is working fine. For me and other admins anyhow. Normal players don't seem to be able to see the different models. Any idea why? I do know that the models are being downloaded but the other players just don't seem to see them.

NeverDie 03-02-2006 04:36

Make sure they have cl_minmodels on 0 or it will not show them

ltcjohnson 03-03-2006 19:57

Is there a way that I can have the server run a command on the client to set cl_minmodels 0 ???

[ --<-@ ] Black Rose 03-03-2006 20:01

Code:
client_cmd(id, "cl_minmodels 0")

Des12 03-03-2006 21:37

I would recommend doing it on connect

Code:
public client_connect(id) {      client_cmd(id, "cl_minmodels 0");        return PLUGIN_HANDLED; }


All times are GMT -4. The time now is 20:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.