Raised This Month: $ Target: $400
 0% 

VIP models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ArthHa
Member
Join Date: Apr 2014
Old 11-22-2014 , 07:27   VIP models
Reply With Quote #1

Hello,

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

public plugin_init() 
{
    register_plugin( "VIP MODELS", "1.0", "ArtHa" );
    RegisterHam( Ham_Spawn, "player", "FnHamSpawn", 1 );
}

public plugin_precache() 
{ 
    precache_model("models/player/vip_ct/vip_ct.mdl");
    precache_model("models/player/vip_t/vip_t.mdl");
}

public FnHamSpawn(id)
{
    if(is_user_alive(id))
    {
        if(get_user_flags(id) & ADMIN_LEVEL_H)
        {
            if(cs_get_user_team(id) == CS_TEAM_CT)
            {
                cs_set_user_model(id,"vip_ct")
            }
                
            else if(cs_get_user_team(id) == CS_TEAM_T)
            {
                cs_set_user_model(id,"vip_t")
            }
        }
    }
}
Everything looks good, but after some time of playing, with this plugin i get:
eK* ArtHa overflowed
Reliable channel overflowed
__________________


ArthHa is offline
Send a message via Skype™ to ArthHa
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 11-22-2014 , 12:21   Re: VIP models
Reply With Quote #2

Don't know if this work, but you can try to check whether he has the model before setting it.
RateX is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-22-2014 , 12:23   Re: VIP models
Reply With Quote #3

Using cs_set_user_model at spawn is a bad way. Hook ClientUserInfochanged and SetClientKeyValue, then change there the models by using set_user_info(index, "model", newModel)
__________________
HamletEagle 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 17:35.


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