Raised This Month: $32 Target: $400
 8% 

need ur help guys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nacho312
Member
Join Date: Mar 2020
Old 03-28-2020 , 08:26   need ur help guys
Reply With Quote #1

hello guys, can anyone of you explain me how to define a skin / model only for a specific level of admins? I want a good explanation so i can understand, this may also help some peoole, I'm a newbie and any help will be appreciated.
nacho312 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 03-28-2020 , 08:45   Re: need ur help guys
Reply With Quote #2

look through OciXCrom's plugins, he has a lot
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
nacho312
Member
Join Date: Mar 2020
Old 03-28-2020 , 08:50   Re: need ur help guys
Reply With Quote #3

Quote:
Originally Posted by Nutu_ View Post
look through OciXCrom's plugins, he has a lot
alright thx alot buddy but may i know also how u guys can do that? i Want to learn
nacho312 is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 03-28-2020 , 08:53   Re: need ur help guys
Reply With Quote #4

just check his sources, how he did that, what he did, it is better while looking through a plugin for learning than reading someone's opinion i guess..
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
nacho312
Member
Join Date: Mar 2020
Old 03-28-2020 , 08:57   Re: need ur help guys
Reply With Quote #5

Quote:
Originally Posted by Nutu_ View Post
just check his sources, how he did that, what he did, it is better while looking through a plugin for learning than reading someone's opinion i guess..
thank you so much for ur reply bro, i'll be waiting for others replies too.
nacho312 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-28-2020 , 09:39   Re: need ur help guys
Reply With Quote #6

You can use this simple plugin:

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

new const SKIN_FLAG ADMIN_RESERVATION
new const SKIN_CT[] = "CustomAdmCT"
new const SKIN_T[] = "CustomAdmT"

new bool:g_bHasCustomSkin[33]

public 
plugin_init()
{
    
register_plugin("Simple VIP Model""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
plugin_precache()
{    
    
precache_player_model(SKIN_CT)
    
precache_player_model(SKIN_T)
}

public 
client_putinserver(id)
    
g_bHasCustomSkin[id] = false

public OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & SKIN_FLAG)
        {
            switch(
cs_get_user_team(id))
            {
                case 
CS_TEAM_CTset_model(idSKIN_CT)
                case 
CS_TEAM_Tset_model(idSKIN_T)
            }
        }
        else if(
g_bHasCustomSkin[id])
        {
            
g_bHasCustomSkin[id] = false
            cs_reset_user_model
(id)
        }
    }
}

set_model(const id, const szModel[])
{
    
cs_set_user_model(idszModel)
    
g_bHasCustomSkin[id] = true
}

stock precache_player_model(const name[], &id 0)
{
    new 
model[128]
    
formatex(modelcharsmax(model), "models/player/%s/%sT.mdl"namename)

    if(
file_exists(model))
        
id precache_generic(model)

    static const 
extension[] = "T.mdl"
    
#pragma unused extension

    
copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")
    return 
precache_model(model)

Configure the model names and admin flag in the beginning in the code.

If you have questions about how to create such codes yourself, I suggest posting in the Scripting Help section after trying to create something. Post your code so we can explain what's wrong.
__________________

Last edited by OciXCrom; 03-28-2020 at 09:39.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nacho312
Member
Join Date: Mar 2020
Old 03-28-2020 , 09:48   Re: need ur help guys
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
You can use this simple plugin:

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

new const SKIN_FLAG ADMIN_RESERVATION
new const SKIN_CT[] = "CustomAdmCT"
new const SKIN_T[] = "CustomAdmT"

new bool:g_bHasCustomSkin[33]

public 
plugin_init()
{
    
register_plugin("Simple VIP Model""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
}

public 
plugin_precache()
{    
    
precache_player_model(SKIN_CT)
    
precache_player_model(SKIN_T)
}

public 
client_putinserver(id)
    
g_bHasCustomSkin[id] = false

public OnPlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & SKIN_FLAG)
        {
            switch(
cs_get_user_team(id))
            {
                case 
CS_TEAM_CTset_model(idSKIN_CT)
                case 
CS_TEAM_Tset_model(idSKIN_T)
            }
        }
        else if(
g_bHasCustomSkin[id])
        {
            
g_bHasCustomSkin[id] = false
            cs_reset_user_model
(id)
        }
    }
}

set_model(const id, const szModel[])
{
    
cs_set_user_model(idszModel)
    
g_bHasCustomSkin[id] = true
}

stock precache_player_model(const name[], &id 0)
{
    new 
model[128]
    
formatex(modelcharsmax(model), "models/player/%s/%sT.mdl"namename)

    if(
file_exists(model))
        
id precache_generic(model)

    static const 
extension[] = "T.mdl"
    
#pragma unused extension

    
copy(model[strlen(model) - charsmax(extension)], charsmax(model), ".mdl")
    return 
precache_model(model)

Configure the model names and admin flag in the beginning in the code.

If you have questions about how to create such codes yourself, I suggest posting in the Scripting Help section after trying to create something. Post your code so we can explain what's wrong.

thank you so much for ur reply i rly rly rly appreciate that , yea i'll do that for sure whenever i'll need help :*
nacho312 is offline
nacho312
Member
Join Date: Mar 2020
Old 03-28-2020 , 09:50   Re: need ur help guys
Reply With Quote #8

btw can you tell me exactly what should i edit and what should i replace , still cant do that

Last edited by nacho312; 03-28-2020 at 09:54.
nacho312 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-28-2020 , 10:08   Re: need ur help guys
Reply With Quote #9

Code:
new const SKIN_FLAG = ADMIN_RESERVATION new const SKIN_CT[] = "CustomAdmCT" new const SKIN_T[] = "CustomAdmT

These are the plugin settings.
The first is the admin flag.
The other 2 are the models for CT and T.
Write only the file names there and put them in "models/player/filename/filename.mdl"
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
nacho312
Member
Join Date: Mar 2020
Old 03-28-2020 , 10:23   Re: need ur help guys
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
Code:
new const SKIN_FLAG = ADMIN_RESERVATION new const SKIN_CT[] = "CustomAdmCT" new const SKIN_T[] = "CustomAdmT

These are the plugin settings.
The first is the admin flag.
The other 2 are the models for CT and T.
Write only the file names there and put them in "models/player/filename/filename.mdl"
thanks alot bro i rly love the way how u guys are helping people, thanks again!
nacho312 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 05:44.


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