AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Little help with scripting admin models file (https://forums.alliedmods.net/showthread.php?t=53984)

xMBx 04-14-2007 17:01

Little help with scripting admin models file
 
I'm talking about this admin model - http://forums.alliedmods.net/showthr...=11391&page=40
How i have to change the source if i want to get working the models in the first round too? Models are working AFTER the first round ends.
And how i can add my own-made models to this plugin? And how i can put a model switcher (if admin picks SAS then the system puts SAS what i added, if admin picks GIGN then the system puts GIGN what i added etc)?

Nican 04-14-2007 18:23

Re: Little help with scripting admin models file
 
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 :/

xMBx 04-15-2007 06:57

Re: Little help with scripting admin models file
 
Quote:

Originally Posted by Nican (Post 464946)
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 04-17-2007 05:33

Re: Little help with scripting admin models file
 
Could someone help me with this? I really need it.

pRED* 04-17-2007 06:16

Re: Little help with scripting admin models file
 
I guess you could try something like..

Code:
cs_reset_user_model(id) new model[20] cs_get_user_model(id, model,19) if equali(model,"gign") {      //Set a admin only model here.. } else if equali(model,"leet") {      //More model setting.. }

xMBx 04-17-2007 09:21

Re: Little help with scripting admin models file
 
Quote:

Originally Posted by pRED* | NZ (Post 466224)
I guess you could try something like..

Code:
cs_reset_user_model(id) new model[20] cs_get_user_model(id, model,19) if equali(model,"gign") {      //Set a admin only model here.. } else if equali(model,"leet") {      //More model setting.. }

Thanks. I will try it later. But how i can get the admin model to the first round (it appears after first round)?


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

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