Raised This Month: $ Target: $400
 0% 

Little help with scripting admin models file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xMBx
Member
Join Date: Mar 2007
Old 04-15-2007 , 06:57   Re: Little help with scripting admin models file
Reply With Quote #3

Quote:
Originally Posted by Nican View Post
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(idlevelcid) {
    
//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"
xMBx is offline
 



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 06:40.


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