Raised This Month: $51 Target: $400
 12% 

Problem with set models to players with some flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 03-04-2011 , 09:09   Problem with set models to players with some flag
Reply With Quote #1

Hello, I'm trying to set models to players with some flag. That is what I do:

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

#define Head_Flags    ADMIN_RCON
#define Admins_Flags    ADMIN_KICK

new const Head_Model[] = "models/player/Neo/Neo.mdl"
new const Admins_Model[] = "models/player/blackangel/blackangel.mdl"
new const T_Model[] = "models/player/female5/female5.mdl"

new const Version[] = "0.3"

public plugin_precache()
{
    
precache_model(Head_Model)
    
precache_model(Admins_Model)
    
precache_model(T_Model)
}

public 
plugin_init()
{
    
register_plugin("Models"Version"Dark_Style")
    
    
RegisterHam(Ham_Spawn"player""set_models"1)
}

public 
set_models(id)
{
    if(!
is_user_alive(id)) return 
    
    if(
get_user_flags(id) && Head_Flags)
    {
        
cs_set_user_model(idHead_Model)
    }
    else if(
get_user_flags(id) && Admins_Flags get_user_team(id) == 1)
    {
        
cs_set_user_model(idAdmins_Model)
    }
    else if(
get_user_flags(id) != Head_Flags && Admins_Flags get_user_team(id) == 1)
    {
        
cs_set_user_model(idT_Model)
    }
    else
    {
        
cs_reset_user_model(id)
    }

I tried few methods, but without results.

Last edited by dark_style; 03-04-2011 at 10:20.
dark_style is offline
Reply



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:49.


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