Plugin-uriStripes Admin-Models

Moderatori: Moderators, Founder

Mesaj

Avatar utilizator
CEO
Posts
3802
Stripes Admin-Models
Autor: AgentStrike

Descriere: Cu acest plugin la voi pe server adminii cu accesul ADMIN KICK vor avea skin-uri speciale fata de ceilalti playerii, in acest sens puteti face diferenta intre un admin si player.

Instalare:
1. Fisierul stripes_adminmodel.amxx il puneti in cstrike/addons/amxmodx/plugins

2. Dupa ce ati downloadat plugin-ul de mai jos il dez-arhivati apoi intrati in folderul numit resurse, acolo veti gasii 2 foldere, copiati acele foldere cu tot-ul la voi in server in cstrike/models/player.

3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma: stripes_adminmodel.amxx

Cod: Selectaţi tot

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define MODEL_DELAY 0.5

enum _:ModelsInfo
{
    Flag,
    CTModel[32],
    TModel[32]
}

new const g_eModels[][ModelsInfo] =
{
    // <Admin flag> <CT skin> <T skin>
    { ADMIN_LEVEL_A, "owner_ct", "owner_t" },
    { ADMIN_LEVEL_B, "admin_ct", "admin_t" }
}

new Trie:g_tModels

public plugin_init()
{
    register_plugin("Multiple Player Models", "1.0", "OciXCrom")
    RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
}

public plugin_end()
    TrieDestroy(g_tModels)

public plugin_precache()
{
    g_tModels = TrieCreate()
    
    for(new i; i < sizeof(g_eModels); i++)
    {
        precache_player_model(g_eModels[i][CTModel])
        precache_player_model(g_eModels[i][TModel])
    }
}

public OnPlayerSpawn(id)
    set_task(MODEL_DELAY, "SetModel", id)
    
public SetModel(id)
{
    if(is_user_alive(id))
    {
        static bool:bMatch, iFlags, i
        bMatch = false
        
        for(iFlags = get_user_flags(id), i = 0; i < sizeof(g_eModels); i++)
        {
            if(iFlags & g_eModels[i][Flag])
            {
                switch(cs_get_user_team(id))
                {
                    case CS_TEAM_CT: cs_set_user_model(id, g_eModels[i][CTModel])
                    case CS_TEAM_T: cs_set_user_model(id, g_eModels[i][TModel])
                }
                
                client_print(id, print_chat, "* Your received the model %s", g_eModels[i][cs_get_user_team(id) == CS_TEAM_CT ? CTModel : TModel])
                bMatch = true
                break
            }
        }
        
        if(!bMatch)
        {
            static szModel[32]
            cs_get_user_model(id, szModel, charsmax(szModel))
            
            if(TrieKeyExists(g_tModels, szModel))
                cs_reset_user_model(id)
        }
    }
}

precache_player_model(szModel[])
{
    TrieSetCell(g_tModels, szModel, 1)
    
    static szFile[128]
    formatex(szFile, charsmax(szFile), "models/player/%s/%s.mdl", szModel, szModel)
    precache_model(szFile)
    replace(szFile, charsmax(szFile), ".mdl", "T.mdl")
    
    if(file_exists(szFile))
        precache_model(szFile)
}
modele: https://forums.alliedmods.net/showthread.php?t=11391
========================
CONTACT : diliulro@yahoo.com
========================
Scrie răspuns