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

vip/admin models


Post New Thread Reply   
 
Thread Tools Display Modes
baly222
Junior Member
Join Date: Jun 2020
Old 06-05-2020 , 09:22   Re: vip/admin models
Reply With Quote #11

Quote:
Originally Posted by supertrio17 View Post
Can you explain this one to me, I don't quite understand
I used what "OciXCrom" shared, I thing its better plugin but need to add automatic chooser for both teams when client join
baly222 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 11:02   Re: vip/admin models
Reply With Quote #12

Quote:
Originally Posted by mahbodsr View Post
Explain more ,
What Skins Do You want to set when Ct/T wins?
You didn't understand him, he wants to set a default model for player when player changes teams, I'm little bit stuck how to do this, but I will find a way
supertrio17 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 11:15   Re: vip/admin models
Reply With Quote #13

I can try something but it's not that promosing, I can make a global Variable that will, every time someone sets his model, change its value given to that model. So I can detect player spawn, and when player spawns if given value is different that round before, players model will be set as Artic or Sas, depends on current team
supertrio17 is offline
baly222
Junior Member
Join Date: Jun 2020
Old 06-05-2020 , 11:17   Re: vip/admin models
Reply With Quote #14

Quote:
Originally Posted by supertrio17 View Post
You didn't understand him, he wants to set a default model for player when player changes teams, I'm little bit stuck how to do this, but I will find a way
Yes its for hns server si teams can be changed every round.
When you join on server you can chose skin for T but next round you can be ct and you still have that skin. And thats bad
baly222 is offline
mahbodsr
Member
Join Date: Jun 2016
Old 06-05-2020 , 11:44   Re: vip/admin models
Reply With Quote #15

Quote:
Originally Posted by baly222 View Post
Yes its for hns server si teams can be changed every round.
When you join on server you can chose skin for T but next round you can be ct and you still have that skin. And thats bad
Give me your models path for both CT / TR
or maybe you want default models?

Last edited by mahbodsr; 06-05-2020 at 11:47.
mahbodsr is offline
baly222
Junior Member
Join Date: Jun 2020
Old 06-05-2020 , 12:16   Re: vip/admin models
Reply With Quote #16

Quote:
Originally Posted by mahbodsr View Post
Give me your models path for both CT / TR
or maybe you want default models?
PHP Code:
 "Special-Agent",  CS_TEAM_CT },
    { 
"Special-Death"CS_TEAM_CT },
    { 
"SpriderMan",   CS_TEAM_T },
    { 
"Joker",  CS_TEAM_T 
baly222 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 14:08   Re: vip/admin models
Reply With Quote #17

Do you want me to add them to that code or replace?
supertrio17 is offline
baly222
Junior Member
Join Date: Jun 2020
Old 06-05-2020 , 14:17   Re: vip/admin models
Reply With Quote #18

Quote:
Originally Posted by supertrio17 View Post
Do you want me to add them to that code or replace?
I replaced it

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

#if !defined MAX_PLAYERS
const MAX_PLAYERS 32
#endif

enum _:ModelInfo
{
    
Name[32],
    
CsTeams:Team,
}

new const 
g_eModels[][ModelInfo] =
{
    { 
"Special-Agent",  CS_TEAM_CT },
    { 
"Special-Death"CS_TEAM_CT },
    { 
"SpiderMan",   CS_TEAM_T },
    { 
"Joker",  CS_TEAM_T }

}

const 
INVALID_SKIN = -1
const MENU_ACCESS_FLAG ADMIN_LEVEL_H
const Float:CONNECT_MSG_DELAY 5.0

new g_iModel[MAX_PLAYERS 1][CsTeams]

public 
plugin_init()
{
    
register_plugin("Models Menu""1.0""OciXCrom")
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)

    
register_clcmd("say /vipskin""Cmd_VipSkin")
    
register_clcmd("say_team /vipskin""Cmd_VipSkin")

    
CC_SetPrefix("&x04[Prefix]")
}

public 
plugin_precache()
{
    for(new 
isizeof(g_eModels); i++)
    {
        
precache_player_model(g_eModels[i][Name])
    }
}

public 
client_putinserver(id)
{
    for(new 
CsTeams:iTeam CS_TEAM_UNASSIGNEDiTeam <= CS_TEAM_SPECTATORiTeam++)
    {
        
g_iModel[id][iTeam] = INVALID_SKIN
    
}

    
set_task(CONNECT_MSG_DELAY"DisplayMessage"id)
}

public 
DisplayMessage(id)
{
    if(
is_user_connected(id) && has_menu_access(id))
    {
        
CC_SendMessage(id"Type &x03/vipskin &x01to open the &x04VIP Skin Menu")
    }
}

public 
OnPlayerSpawn(id)
{
    if(!
is_user_alive(id))
    {
        return
    }

    new 
iModel g_iModel[id][cs_get_user_team(id)]

    if(
iModel == INVALID_SKIN)
    {
        return
    }

    
cs_set_user_model(idg_eModels[iModel][Name])
}

public 
Cmd_VipSkin(id)
{
    if(!
has_menu_access(id))
    {
        
CC_SendMessage(id"Only vips can open this menu, sorry!")
        return 
PLUGIN_HANDLED
    
}

    new 
iMenu menu_create("Select Your Skin""VipSkin_Handler")

    for(new 
CsTeams:iTeam cs_get_user_team(id), szNum[5], isizeof(g_eModels); i++)
    {
        if(
g_eModels[i][Team] == iTeam)
        {
            
num_to_str(iszNumcharsmax(szNum))
            
menu_additem(iMenug_eModels[i][Name], szNum)
        }
    }

    
menu_display(idiMenu)
    return 
PLUGIN_HANDLED
}

public 
VipSkin_Handler(idiMenuiItem)
{
    if(!
has_menu_access(id))
    {
        goto @
destroy
    
}

    static 
_unused[1]

    new 
szModelId[5]
    
menu_item_getinfo(iMenuiItem_unused[0], szModelIdcharsmax(szModelId), _unusedcharsmax(_unused), _unused[0])

    new 
iModel str_to_num(szModelId)
    new 
CsTeams:iTeam cs_get_user_team(id)

    if(
g_eModels[iModel][Team] != iTeam)
    {
        goto @
destroy
    
}

    
g_iModel[id][iTeam] = iModel
    CC_SendMessage
(id"You have selected the skin &x04%s"g_eModels[iModel][Name])

    if(
is_user_alive(id))
    {
        
cs_set_user_model(idg_eModels[iModel][Name])
    }

    @
destroy:
    
menu_destroy(iMenu)
    return 
PLUGIN_HANDLED
}

bool:has_menu_access(id)
{
    return (
get_user_flags(id) & MENU_ACCESS_FLAG) != 0
}

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

    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)

baly222 is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-05-2020 , 14:24   Re: vip/admin models
Reply With Quote #19

Oh, you are using his plugin, okay
supertrio17 is offline
baly222
Junior Member
Join Date: Jun 2020
Old 06-05-2020 , 14:26   Re: vip/admin models
Reply With Quote #20

Quote:
Originally Posted by supertrio17 View Post
Oh, you are using his plugin, okay
firt one has problems with Nonsteam players
baly222 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 19:41.


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