Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <cstrike>
- #include <hamsandwich>
- #define FOR_KZ 1
- // 请修改成相应的权限
- #define ADMIN_MM_LEVEL ADMIN_LEVEL_E // "q"
- // 请修改成你所需要的模型
- new g_Model[2][]={
- "alsyadidas", // MM(T)
- "alsynike" // MM(CT)
- }
- public plugin_init(){
- register_plugin("Admin Model","2.3","Rulzy")
- RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn", 1 )
- }
- public plugin_precache() {
- precache_model("models/player/alsyadidas/alsyadidas.mdl")
- precache_model("models/player/alsynike/alsynike.mdl")
- return PLUGIN_CONTINUE
- }
- public fw_PlayerSpawn(id)
- {
- if(!is_user_alive(id)) return
- #if FOR_KZ
- if (get_user_flags(id) & ADMIN_MM_LEVEL){
- cs_set_user_model(id, g_Model[random_num(0, 1)])
- }
- #else
- new CsTeams:userTeam = cs_get_user_team(id);
- new ModelIndex = -1;
- new flags = get_user_flags(id);
- if (flags & ADMIN_MM_LEVEL){
- if (userTeam == CS_TEAM_T){
- ModelIndex = 0
- }
- else if(userTeam == CS_TEAM_CT) {
- ModelIndex = 1
- }
- }
- if(ModelIndex==-1)
- {
- cs_reset_user_model(id);
- }else{
- cs_set_user_model(id, g_Model[ModelIndex]);
- }
- #endif
- }
Add Comment
Please, Sign In to add comment