AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   VIP models (https://forums.alliedmods.net/showthread.php?t=251916)

ArthHa 11-22-2014 07:27

VIP models
 
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

RateX 11-22-2014 12:21

Re: VIP models
 
Don't know if this work, but you can try to check whether he has the model before setting it.

HamletEagle 11-22-2014 12:23

Re: VIP models
 
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)


All times are GMT -4. The time now is 17:35.

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