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

REQ a Simply HAT Plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iTouch
Member
Join Date: Feb 2011
Old 01-03-2012 , 11:09   REQ a Simply HAT Plugin.
Reply With Quote #1

Hello guys i use VIP-s on my server Terrors have a Black Smith model
CT-s Has a White Smith model

I've created two hats for them but

I made the VIP plugin with this script.

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

public plugin_init() {
        
register_plugin("AMX Admin Model""1.1.1""whitemike")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
        
precache_model("models/player/model/model.mdl")
        
precache_model("models/player/model/model.mdl")

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_KICK) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"model")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"model")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE

I tried the same thing with the hats but didn't work i think it is a extra thing can some one make it for me.
__________________
Feel the diference
iTouch is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-03-2012 , 11:13   Re: REQ a Simply HAT Plugin.
Reply With Quote #2

Find a hats plugin you want to use and we can edit it for VIP's only.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
iTouch
Member
Join Date: Feb 2011
Old 01-03-2012 , 11:17   Re: REQ a Simply HAT Plugin.
Reply With Quote #3

Well i Found it finally it is for admins but vip-s use a Admin_level to so i think you could fix it without problems.

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

new g_adminmarkEnt[33]
new 
cvar_enable
new MODEL_MARK[]     = "models/admin_head.mdl"

static const PLUGIN_NAME[]     = "Admin Mark"
static const PLUGIN_AUTHOR[]     = "KaLoSZyFeR"
static const PLUGIN_VERSION[]    = "1.2"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER)    
    
cvar_enable register_cvar("amx_admin_mark""1")
}

public 
plugin_precache()
{
    
precache_model(MODEL_MARK)    
    
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/gign/gign.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/gsg9/gsg9.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/sas/sas.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/urban/urban.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/vip/vip.mdl")

    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/arctic/arctic.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/guerilla/guerilla.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/leet/leet.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/terror/terror.mdl")    
}

public 
client_connect(id)
{
    if(
g_adminmarkEnt[id] > 0)
        
remove_entity(g_adminmarkEnt[id])
    
g_adminmarkEnt[id] = 0
}

public 
client_disconnect(id)
{
    if(
g_adminmarkEnt[id] > 0)
        
remove_entity(g_adminmarkEnt[id])
    
g_adminmarkEnt[id] = 0
}

public 
client_PreThink(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE
    
    
if(!is_user_alive(id) && g_adminmarkEnt[id] > 0)
    {
        
remove_entity(g_adminmarkEnt[id])
        
g_adminmarkEnt[id] = 0
        
        
return PLUGIN_CONTINUE
    
}
    
    if (!(
get_user_flags(id) & ADMIN_KICK))
    {
        
remove_entity(g_adminmarkEnt[id])
        
g_adminmarkEnt[id] = 0
        
        
return PLUGIN_CONTINUE
    
}
    
    if(!
get_pcvar_num(cvar_enable))
        return 
PLUGIN_CONTINUE
        
    
if(!is_user_alive(id))
        return 
PLUGIN_CONTINUE
        
    
if(g_adminmarkEnt[id] < 1)
    {
        
g_adminmarkEnt[id] = create_entity("info_target")
        if(
g_adminmarkEnt[id] > 0)
        {
            
entity_set_int(g_adminmarkEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW)
            
entity_set_edict(g_adminmarkEnt[id], EV_ENT_aimentid)
            
entity_set_model(g_adminmarkEnt[id], MODEL_MARK)            
        }
    }
    
    if (
g_adminmarkEnt[id] > 0)
    {
        new 
modelID get_model_id(id)
        
entity_set_int(g_adminmarkEnt[id], EV_INT_bodymodelID)
    }

    if(
g_adminmarkEnt[id] < 1)
        return 
PLUGIN_CONTINUE

    
return PLUGIN_CONTINUE
}

new 
modelname[9][] ={
    
"gign",
    
"gsg9",
    
"sas",
    
"urban",
    
"vip",
    
"arctic",
    
"guerilla",
    
"leet",
    
"terror"
}

public 
get_model_id(id)
{
    new 
modelStr[32], iNum=32modelID
    get_user_info
(id,"model",modelStr,iNum)
    
    for(new 
09i++)
    {
        if (
equali (modelStrmodelname[i]) )
        {
            
modelID i
        
}
    }    
    return 
modelID

https://forums.alliedmods.net/showthread.php?t=56751

//My files
Vip models are :
w_smith/w_smith.mdl
smith/smith.mdl
Vips have ADMIN_CVAR acces
Hat moddels are:
w_smith/w_hat.mdl
smith/hat.mdl
__________________
Feel the diference

Last edited by iTouch; 01-03-2012 at 11:21.
iTouch is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-03-2012 , 11:47   Re: REQ a Simply HAT Plugin.
Reply With Quote #4

Change the model paths to the appropriate files that you use.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

new g_adminmarkEnt[33]
new 
cvar_enable
new MODEL_T[]  = "models/admin_head.mdl"
new MODEL_CT[] = "models/admin_head.mdl"

static const PLUGIN_NAME[]     = "Admin Mark"
static const PLUGIN_AUTHOR[]     = "KaLoSZyFeR"
static const PLUGIN_VERSION[]    = "1.2"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER)    
    
cvar_enable register_cvar("amx_admin_mark""1")
}

public 
plugin_precache()
{
    
precache_model(MODEL_T)
    
precache_model(MODEL_CT)
}

public 
client_connect(id)
{
    if(
g_adminmarkEnt[id] > 0)
        
remove_entity(g_adminmarkEnt[id])
    
g_adminmarkEnt[id] = 0
}

public 
client_disconnect(id)
{
    if(
g_adminmarkEnt[id] > 0)
        
remove_entity(g_adminmarkEnt[id])
    
g_adminmarkEnt[id] = 0
}

public 
client_PreThink(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE
    
    
if(!is_user_alive(id) && g_adminmarkEnt[id] > 0)
    {
        
remove_entity(g_adminmarkEnt[id])
        
g_adminmarkEnt[id] = 0
        
        
return PLUGIN_CONTINUE
    
}
    
    if (!(
get_user_flags(id) & ADMIN_KICK))
    {
        
remove_entity(g_adminmarkEnt[id])
        
g_adminmarkEnt[id] = 0
        
        
return PLUGIN_CONTINUE
    
}
    
    if(!
get_pcvar_num(cvar_enable))
        return 
PLUGIN_CONTINUE
        
    
if(!is_user_alive(id))
        return 
PLUGIN_CONTINUE
        
    
if(g_adminmarkEnt[id] < 1)
    {
        
g_adminmarkEnt[id] = create_entity("info_target")
        if(
g_adminmarkEnt[id] > 0)
        {
            
entity_set_int(g_adminmarkEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW)
            
entity_set_edict(g_adminmarkEnt[id], EV_ENT_aimentid)
            
entity_set_model(g_adminmarkEnt[id], get_user_team(id) == MODEL_T MODEL_CT)            
        }
    }

    if(
g_adminmarkEnt[id] < 1)
        return 
PLUGIN_CONTINUE

    
return PLUGIN_CONTINUE

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 01-03-2012 at 11:48.
Exolent[jNr] is offline
iTouch
Member
Join Date: Feb 2011
Old 01-03-2012 , 11:51   Re: REQ a Simply HAT Plugin.
Reply With Quote #5

Well i came this far but the problem is i use 2 models one for the T team one for the Ct team can you edit it please ?.

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

new g_adminmarkEnt[33]
new 
cvar_enable
new MODEL_MARK[]     = "models/player/smith_w/w_hat.mdl"

static const PLUGIN_NAME[]     = "VIP Hat"
static const PLUGIN_AUTHOR[]     = "KaLoSZyFeR"
static const PLUGIN_VERSION[]    = "1.2"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER)    
    
cvar_enable register_cvar("amx_admin_mark""1")
}

public 
plugin_precache()
{
    
precache_model(MODEL_MARK)    
    
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/smith/smith.mdl")
    
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/smith_w/smith_w.mdl")  
}

public 
client_connect(id)
{
    if(
g_adminmarkEnt[id] > 0)
        
remove_entity(g_adminmarkEnt[id])
    
g_adminmarkEnt[id] = 0
}

public 
client_disconnect(id)
{
    if(
g_adminmarkEnt[id] > 0)
        
remove_entity(g_adminmarkEnt[id])
    
g_adminmarkEnt[id] = 0
}

public 
client_PreThink(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_CONTINUE
    
    
if(!is_user_alive(id) && g_adminmarkEnt[id] > 0)
    {
        
remove_entity(g_adminmarkEnt[id])
        
g_adminmarkEnt[id] = 0
        
        
return PLUGIN_CONTINUE
    
}
    
    if (!(
get_user_flags(id) & ADMIN_CVAR))
    {
        
remove_entity(g_adminmarkEnt[id])
        
g_adminmarkEnt[id] = 0
        
        
return PLUGIN_CONTINUE
    
}
    
    if(!
get_pcvar_num(cvar_enable))
        return 
PLUGIN_CONTINUE
        
    
if(!is_user_alive(id))
        return 
PLUGIN_CONTINUE
        
    
if(g_adminmarkEnt[id] < 1)
    {
        
g_adminmarkEnt[id] = create_entity("info_target")
        if(
g_adminmarkEnt[id] > 0)
        {
            
entity_set_int(g_adminmarkEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW)
            
entity_set_edict(g_adminmarkEnt[id], EV_ENT_aimentid)
            
entity_set_model(g_adminmarkEnt[id], MODEL_MARK)            
        }
    }
    
    if (
g_adminmarkEnt[id] > 0)
    {
        new 
modelID get_model_id(id)
        
entity_set_int(g_adminmarkEnt[id], EV_INT_bodymodelID)
    }

    if(
g_adminmarkEnt[id] < 1)
        return 
PLUGIN_CONTINUE

    
return PLUGIN_CONTINUE
}

new 
modelname[9][] ={
    
"smith",
    
"smith_w",
}

public 
get_model_id(id)
{
    new 
modelStr[32], iNum=32modelID
    get_user_info
(id,"model",modelStr,iNum)
    
    for(new 
09i++)
    {
        if (
equali (modelStrmodelname[i]) )
        {
            
modelID i
        
}
    }    
    return 
modelID

__________________
Feel the diference
iTouch is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-03-2012 , 11:59   Re: REQ a Simply HAT Plugin.
Reply With Quote #6

The code I posted is for the hats only.
Use the other plugin you posted for the player models.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 01-03-2012 at 11:59.
Exolent[jNr] is offline
iTouch
Member
Join Date: Feb 2011
Old 01-03-2012 , 12:00   Re: REQ a Simply HAT Plugin.
Reply With Quote #7

ohh haven't seen it thanks a lot.

Problem Solved <3
__________________
Feel the diference

Last edited by iTouch; 01-03-2012 at 12:11.
iTouch 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 10:42.


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