Raised This Month: $ Target: $400
 0% 

Multiple Models


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Gasior
Member
Join Date: Mar 2012
Old 08-11-2013 , 14:35   Multiple Models
Reply With Quote #1

Hi,
I am trying to do a multiple models plugin. The way it will work is by saying /madmin you get model of admin etc. So I tried lots of combination and any of them don't work correctly. My sma so far looks like that
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define ADMIN_FLAG_X (1<<23)

new model1[33]
new 
model2[33]
new 
model3[33]

public 
plugin_init() {
        
register_plugin("Modele VIP""1.0""Gasior")
        
register_event("ResetHUD""resetModel""b")
        
register_clcmd("say /modele1""modelevip")
        
register_clcmd("say /modele2""modele2vip")
        
register_clcmd("say /modele3""modele3vip")
        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 
client_authorized(id)
{
model1[id] = false;
model3[id] = false;
model2[id] = false;
}

public 
modelevip(id)
{
        if(
get_user_flags(id) & ADMIN_FLAG_X) {
    
model1[id] = true;
    
model2[id] = false;
    
model3[id] = false;
}
}

public 
modele2vip(id)
{
        if(
get_user_flags(id) & ADMIN_FLAG_X) {
    
model1[id] = false;
    
model2[id] = true;
    
model3[id] = false;
}
}

public 
modele3vip(id)
{
        if(
get_user_flags(id) & ADMIN_FLAG_X) {
    
model1[id] = false;
    
model2[id] = false;
    
model3[id] = true;
}
}

public 
resetModel(idlevelcid) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
model1[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)
                }
    }
        if (
model2[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)
                }
    }
        if (
model3[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

I'll be thankful for any help or suggestion.
Gasior is offline
 


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 15:53.


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