AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Models (https://forums.alliedmods.net/showthread.php?t=16934)

Khali 08-23-2005 03:07

Models
 
I found this script by KaOs:
Code:

/*##########################################################################
##
## -- www.SteamTools.net
##      ___  _____      ___  ___  _  __  _            ___  ___  _____  _     
##    /  | |  _  \    /  |/  | | | |  \ | |          /  |/  | |  _  \ | |     
##    / /| | | | | |    / /|  /| | | | |  \| |        / /|  /| | | | | | | |     
##  / / | | | | | |  / / |__/ | | | | | |\  |        / / |__/ | | | | | | | |     
##  / /  | | | |_| |  / /      | | | | | | \  |      / /      | | | |_| | | |___ 
## /_/  |_| |_____/ /_/        |_| |_| |_|  \_|      /_/        |_| |_____/ |_____|
##                                                       
##          |__                  |__  o _|_  ___  __ __  o |__,  ___ 
##      --  |__) (__|    (__(__( |  ) |  |_, (__/_ |  )  ) | |  \ (__/_
##                  |                                                   
##
##  Originated as a simple idea back in 2004, it was forgotten due to
## lack of my 'Small' coding skills. However I have progressed in recent
## months and somehow crossed that old post with this concept in it. So
## naturally I challenged myself to see if I could do it, and voila! I
## could :)
##
##  Once you join, you play a normal person for the first round, and for
## all remaining rounds your CT or TE models are custom. They now read
## "ADMIN" on front and back, and also have small "A" patches on the arms.
## I designed these models myself, it's very easy, just bring the textures
## into photoshop, tweak out, and replace.
##
##  Enjoy!
##
##
## CHANGELOG
##------------------------------------------------------------------------
## 2) v1.1.1 - Fixed missing event
## 1) v1.1.0 - Fixed VIP and other model bugs
##
##
## INSTALLATION
##------------------------------------------------------------------------
## 1) Unzip (which you may have done already)
## 2) Place 'amx_adminmodel.amxx' in 'cstrike/addons/amxmodx/plugins'
## 3) Add a line in 'configs/plugins.ini' containing 'amx_adminmodel.amxx'
## 4) Put the 'admin_ct' and 'admin_te' folders into 'cstrike/models' folder
## 5) -- Visit www.SteamTools.net and enjoy your new plugin!
##
##
##
## THE CVARs
##------------------------------------------------------------------------
##
## No CVARs for this plugin :)
##
##
##########################################################################*/       


#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/admin_ct/admin_ct.mdl")
        precache_model("models/player/admin_te/admin_te.mdl")

        return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
        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, "admin_te")
                }
                else if(userTeam == CS_TEAM_CT) {
                        cs_set_user_model(id, "admin_ct")
                }
                else {
                        cs_reset_user_model(id)
                }
        }

        return PLUGIN_CONTINUE
}

I was wondering, if there's a way to set it to check Steam IDs, rather than ADMIN_KICK. Possible?

Bend3R 08-23-2005 03:25

You would not post this in here,
you may portreply post in KaOs plugin and ask him or another person for help in there

DahVid 08-23-2005 03:45

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> new g_SteamIdLocation[]="addons/amxmodx/configs/adminmodel.txt" new line,text[64],txtlen new authid[33]     public plugin_init() {     register_plugin("AMX Admin Model", "1.1.1", "whitemike")     register_event("ResetHUD", "resetModel", "b")     register_clcmd("amx_addmodel","addmodel",ADMIN_BAN)     return PLUGIN_CONTINUE } public plugin_precache() {     precache_model("models/player/admin_ct/admin_ct.mdl")     precache_model("models/player/admin_te/admin_te.mdl")         return PLUGIN_CONTINUE } public resetModel(id) {     get_user_authid(id,authid,32)         while((line = read_file(g_SteamIdLocation,line,text,63,txtlen)) != 0) {         if(equali(text,authid)) {                         new CsTeams:userTeam = cs_get_user_team(id)             if (userTeam == CS_TEAM_T) {                 cs_set_user_model(id, "admin_te")             }             else if(userTeam == CS_TEAM_CT) {                 cs_set_user_model(id, "admin_ct")             }             else {                 cs_reset_user_model(id)             }             return PLUGIN_CONTINUE         }     }     return PLUGIN_CONTINUE } public addmodel(id) {         new arg[50]         read_argv(1,arg,49)         new target=cmd_target(id,arg,9)         get_user_authid(target,authid,32)         new txtformat[50]         format(txtformat,49,"%s",authid)         write_file(g_SteamIdLocation,txtformat,-1)         client_print(id,print_console,"Wrote steamid to the list of AdminModelmab00bers!") }

I did a little edit job on it. Pretty sure it will work. Place all of your STEAM_ID's in addons/amxmodx/configs/adminmodel.txt

One on top of eachother like

STEAM_ID_BLA
STEAM_ID_BLA

Alternately, I added a command to add them in-game. Meaning no editting the file.
amx_addmodel name

I hope it works for you!


All times are GMT -4. The time now is 14:31.

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