AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin team skins (https://forums.alliedmods.net/showthread.php?t=27196)

m0rfin 04-16-2006 23:08

Admin team skins
 
What do i write to make that
T gets 1 skin
and CT gets another skin

This is my plugin:
Code:

#include <amxmodx>
#include <cstrike>

public plugin_init()
{
  register_plugin("m0rfin's Custom Models" , "0.1" , "m0rfin");
  register_event("ResetHUD" , "event_ResetHUD" , "f");
}

public plugin_precache()
{
  // notice the path structure
  precache_model("player/gign/slewme.mdl");
}

public event_ResetHUD(id)
  set_task(1.0 , "set_model" , id);

public set_model(id)
{
  if(is_user_alive(id)) // check if the player is alive
  {
    // get the player's auth id
    new authid[33];
    get_user_authid(id , authid , 32);

    // check the player's authid for a match
    if(equal(authid , "STEAM_0:1:3611893"))
    {
      // and finally set the model
      cs_set_user_model(id , "slewme");
    }
  }
}


FrontLine 04-16-2006 23:13

take my old version of halo skins for example...

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("Halo Skins", "0.2", "Front Line")     register_event("ResetHUD", "resetModel", "b")     return PLUGIN_CONTINUE } public plugin_precache() {    precache_model "models/player/halo_t/halo_t.mdl"    precache_model "models/player/halo_ct/halo_ct.mdl"       return PLUGIN_CONTINUE } public resetModel(id) {      if (cs_get_user_team(id) == 1) {         cs_set_user_model(id, "halo_t")     }     else if(cs_get_user_team(id) == 2) {         cs_set_user_model(id, "halo_ct")     }     return PLUGIN_CONTINUE }

Althought i was told that doesn't work anymore...
So try this way...

Code:
#include <amxmodx> #include <cstrike> public plugin_init() {       register_plugin("Halo Skins", "0.5", "Front Line")       register_event("ResetHUD", "resetModel", "b")       return PLUGIN_CONTINUE   }   public plugin_precache() {       precache_model("models/player/halo_t/halo_t.mdl")       precache_model("models/player/halo_ct/halo_ct.mdl")                     return PLUGIN_CONTINUE   }   public resetModel(id)       {             new CsTeams:userTeam = cs_get_user_team(id)       if (userTeam == CS_TEAM_T) {           cs_set_user_model(id,"halo_t")       }       else if(userTeam == CS_TEAM_CT) {           cs_set_user_model(id,"halo_ct")               }       else {           cs_reset_user_model(id)                     }       return PLUGIN_CONTINUE   }

FL.

m0rfin 04-16-2006 23:26

Quote:

Originally Posted by FrontLine
take my old version of halo skins for example...

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("Halo Skins", "0.2", "Front Line")     register_event("ResetHUD", "resetModel", "b")     return PLUGIN_CONTINUE } public plugin_precache() {    precache_model "models/player/halo_t/halo_t.mdl"    precache_model "models/player/halo_ct/halo_ct.mdl"       return PLUGIN_CONTINUE } public resetModel(id) {      if (cs_get_user_team(id) == 1) {         cs_set_user_model(id, "halo_t")     }     else if(cs_get_user_team(id) == 2) {         cs_set_user_model(id, "halo_ct")     }     return PLUGIN_CONTINUE }

Althought i was told that doesn't work anymore...
So try this way...

Code:
#include <amxmodx> #include <cstrike> public plugin_init() {       register_plugin("Halo Skins", "0.5", "Front Line")       register_event("ResetHUD", "resetModel", "b")       return PLUGIN_CONTINUE   }   public plugin_precache() {       precache_model("models/player/halo_t/halo_t.mdl")       precache_model("models/player/halo_ct/halo_ct.mdl")                     return PLUGIN_CONTINUE   }   public resetModel(id)       {             new CsTeams:userTeam = cs_get_user_team(id)       if (userTeam == CS_TEAM_T) {           cs_set_user_model(id,"halo_t")       }       else if(userTeam == CS_TEAM_CT) {           cs_set_user_model(id,"halo_ct")               }       else {           cs_reset_user_model(id)                     }       return PLUGIN_CONTINUE   }

FL.

ya but i want the Admins to have custom model. not everyone :)

spunko 04-18-2006 15:42

use this plugin..

http://forums.alliedmods.net/showthr...t=11391+models

Xanimos 04-18-2006 16:03

Just so you know the player model must be in.

models/<model_name>/<model_name>.mdl

ie: models/admin_ct/admin_ct.mdl

not: models/gign/slewme.mdl


All times are GMT -4. The time now is 05:01.

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