Raised This Month: $ Target: $400
 0% 

Help on Team Models plugin [CS 1.6]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chaotix911
Junior Member
Join Date: Jun 2010
Old 06-11-2011 , 03:43   Help on Team Models plugin [CS 1.6]
Reply With Quote #1

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   


Last edited by chaotix911; 06-11-2011 at 03:56.
chaotix911 is offline
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 06-11-2011 , 04:31   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #2

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   
}  
public 
client_putinserver(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   

Dr7sTyLe is offline
Old 06-11-2011, 04:49
chaotix911
This message has been deleted by chaotix911.
chaotix911
Junior Member
Join Date: Jun 2010
Old 06-11-2011 , 04:57   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #4

still the same. I restarted server, everyone joins team and they have normal models on. but when everyone dies or after new round, they get the new models. and when other people enter in the middle of the game, they have old models. but when they die they get new.

chaotix911 is offline
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 06-11-2011 , 05:06   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #5

PHP Code:
#include <amxmodx> 
#include <cstrike> 

public plugin_init() {    
    
register_plugin("Halo Skins""0.5""Front Line")    
    
register_event("ResetHUD""resetModel""b")   
    
register_logevent("roundstart"2"1=Round_Start")

    return 
PLUGIN_CONTINUE    
}    
public 
roundstart(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 
   
}
    
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    
}   
public 
client_putinserver(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    

Dr7sTyLe is offline
chaotix911
Junior Member
Join Date: Jun 2010
Old 06-11-2011 , 05:11   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #6

Quote:
Originally Posted by Dr7sTyLe View Post
PHP Code:
#include <amxmodx> 
#include <cstrike> 

public plugin_init() {    
    
register_plugin("Halo Skins""0.5""Front Line")    
    
register_event("ResetHUD""resetModel""b")   
    
register_logevent("roundstart"2"1=Round_Start")

    return 
PLUGIN_CONTINUE    
}    
public 
roundstart(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 
   
}
    
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    
}   
public 
client_putinserver(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    

thank you! ill try that one!

Edit: Still won't work! I just realized you just repeated most of the stuff but thanks for the effort!

Last edited by chaotix911; 06-11-2011 at 05:15.
chaotix911 is offline
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 06-11-2011 , 05:16   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #7

im using this:
PHP Code:
/*########################################################################## 
## 
## -- www.SteamTools.net 
##      ___   _____       ___  ___   _   __   _            ___  ___   _____   _      
##     /   | |  _  \     /   |/   | | | |  \ | |          /   |/   | |  _  \ | |      
##    / /| | | | | |    / /|   /| | | | |   \| |         / /|   /| | | | | | | |      
##   / / | | | | | |   / / |__/ | | | | | |\   |        / / |__/ | | | | | | | |      
##  / /  | | | |_| |  / /       | | | | | | \  |       / /       | | | |_| | | |___  
## /_/   |_| |_____/ /_/        |_| |_| |_|  \_|      /_/        |_| |_____/ |_____| 
##                                                        
##          |__                   |__  o _|_   ___   __ __  o |__,  ___  
##      --  |__) (__|     (__(__( |  ) |  |_, (__/_ |  )  ) | |  \ (__/_ 
##                  |                                                    
##                                                                  
##   Originated as a simple idea back in 2004, it was forgotten due to 
## lack of my 'Small' coding skills. However I have progressed in recent 
## months and somehow crossed that old post with this concept in it. So 
## naturally I challenged myself to see if I could do it, and voila! I 
## could :) 
## 
##   Once you join, you play a normal person for the first round, and for 
## all remaining rounds your CT or TE models are custom. They now read 
## "ADMIN" on front and back, and also have small "A" patches on the arms. 
## I designed these models myself, it's very easy, just bring the textures 
## into photoshop, tweak out, and replace. 
## 
##   Enjoy! 
## 
## 
## CHANGELOG 
##------------------------------------------------------------------------ 
## 2) v1.1.1 - Fixed missing event 
## 1) v1.1.0 - Fixed VIP and other model bugs 
## 
## 
## INSTALLATION 
##------------------------------------------------------------------------ 
## 1) Unzip (which you may have done already) 
## 2) Place 'amx_adminmodel.amxx' in 'cstrike/addons/amxmodx/plugins' 
## 3) Add a line in 'configs/plugins.ini' containing 'amx_adminmodel.amxx' 
## 4) Put the 'admin_ct' and 'admin_te' folders into 'cstrike/models' folder 
## 5) -- Visit www.SteamTools.net and enjoy your new plugin! 
## 
## 
## 
## THE CVARs 
##------------------------------------------------------------------------ 
## 
## No CVARs for this plugin :) 
## 
## 
##########################################################################*/    


#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <nvault>

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/LoopT/LoopT.mdl")
        
precache_model("models/player/LoopCT/LoopCT.mdl")

        return 
PLUGIN_CONTINUE
}
Event_Roundstart(id){
    
set_task(1.0"resetModel",id,level,cid)
}
public 
resetModel(idlevelcid) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"LoopT")
                }
                else if(
userTeam == CS_TEAM_CT) {
                         
cs_set_user_model(id,"LoopCT")
                }
        return 
PLUGIN_CONTINUE
       

its works perfect on my jailbreak Server :O)
Dr7sTyLe is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-11-2011 , 05:18   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #8

Use this plugin, it's much better.

http://forums.alliedmods.net/showthread.php?p=958925
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
chaotix911
Junior Member
Join Date: Jun 2010
Old 06-11-2011 , 05:19   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #9

@Dr7sTyLe can i edit your code to test it on mine? apparently there are many words in your script that arent on mine besides the top part

@Connor Ill test it out too! I couldnt find that when I searched for it in the forum. oh well :O

Edit: @Dr7sTyLe i used and edit your own code. the same thing keeps happening. apparently, when there are no players in the other team and the round didnt start yet, the players in my team have old models on. but when a player joins the other team, the round starts and everyone has new models EXCEPT for the player who just joined. players who just joined get old models until they die.

@Connor I tested your plugin, apparently, it doesnt work on my server. I put everything in place even the player_models.ini. Here is what's written in the .ini file

Code:
; replace default skins
;"defaultname" "newname"

gsg9 vip
gign vip
sas vip
urban vip
militia hns_t_mm1

terror hns_t_mm1
leet hns_t_mm1
arctic hns_t_mm1
guerilla hns_t_mm1
spetsnaz vip

; set skin according to steamid
;"STEAM_0:1:23456789" "terrorist_model" "ct_model"
;"BOT" "bot_te_model" "bot_ct_model"

Last edited by chaotix911; 06-11-2011 at 05:30.
chaotix911 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-11-2011 , 05:37   Re: Help on Team Models plugin [CS 1.6]
Reply With Quote #10

Try this version : http://forums.alliedmods.net/showpos...&postcount=359

And try those settings (quotes added) :

Code:
"gsg9" "vip"
"gign" "vip"
"sas" "vip"
"urban" "vip"
"spetsnaz" "vip"

"terror" "hns_t_mm1"
"leet" "hns_t_mm1"
"arctic" "hns_t_mm1"
"guerilla" "hns_t_mm1"
"militia" "hns_t_mm1"
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 23:26.


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