Raised This Month: $ Target: $400
 0% 

Admin Models code help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ltcjohnson
Junior Member
Join Date: Nov 2004
Old 03-01-2006 , 11:34   Admin Models code help
Reply With Quote #1

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
ltcjohnson is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-01-2006 , 11:47  
Reply With Quote #2

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 }
[ --<-@ ] Black Rose is offline
ltcjohnson
Junior Member
Join Date: Nov 2004
Old 03-01-2006 , 11:51  
Reply With Quote #3

Thanks for the quick reply. I will try that as soon as I can. Again thank man.
ltcjohnson is offline
ltcjohnson
Junior Member
Join Date: Nov 2004
Old 03-01-2006 , 19:37  
Reply With Quote #4

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

Code:
ADMIN_LEVEL_A
That is this right
Code:
m - custom level A
ltcjohnson is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-01-2006 , 19:52  
Reply With Quote #5

yes
[ --<-@ ] Black Rose is offline
ltcjohnson
Junior Member
Join Date: Nov 2004
Old 03-01-2006 , 22:08  
Reply With Quote #6

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.
ltcjohnson is offline
NeverDie
Junior Member
Join Date: Mar 2006
Old 03-02-2006 , 04:36  
Reply With Quote #7

Make sure they have cl_minmodels on 0 or it will not show them
NeverDie is offline
ltcjohnson
Junior Member
Join Date: Nov 2004
Old 03-03-2006 , 19:57  
Reply With Quote #8

Is there a way that I can have the server run a command on the client to set cl_minmodels 0 ???
ltcjohnson is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 03-03-2006 , 20:01  
Reply With Quote #9

Code:
client_cmd(id, "cl_minmodels 0")
[ --<-@ ] Black Rose is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-03-2006 , 21:37  
Reply With Quote #10

I would recommend doing it on connect

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

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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