xDmG™
Bun Venit pe xDmG Te rugam Sa te inregistrezi


Schimbare skin cutit cu o acadea

Vezi subiectul anterior Vezi subiectul urmator In jos

Schimbare skin cutit cu o acadea

Mesaj Scris de ● JokeR ● la data de Sam Oct 29, 2011 3:13 am

Cod:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Knife Model's"
#define VERSION "0.2"
#define AUTHOR "P.Of.Pw"

#define V_MODEL "models/model_cutit.mdl"


//#define KNIFE_W_MODEL "models/server/w_nume_model.mdl"

public plugin_init()
{
  register_plugin(PLUGIN, VERSION, AUTHOR)

  // HL Event CurWeapon
  register_event("CurWeapon", "Event_CurWeapon", "be","1=1");
 
  // FM_SetModel Fakemeta forward
  register_forward(FM_SetModel,"fw_setmodel"/*,1*/);
}


// Plugin Precache forward
public plugin_precache()
{
  // precache the required models
  engfunc(EngFunc_PrecacheModel,V_MODEL);
  //engfunc(EngFunc_PrecacheModel,P_MODEL);
  //engfunc(EngFunc_PrecacheModel,W_MODEL);
}


 
public Event_CurWeapon(id)
{   
  if(!is_user_alive(id))
      return PLUGIN_CONTINUE;
 
  new weaponID = read_data(2);

  if(weaponID != CSW_KNIFE) // Inportat inlocuti Knife daca vrei sa puneti o arma.. ex: Deagle deci CSW_Deagle
      return PLUGIN_CONTINUE;

  set_pev(id, pev_viewmodel2, V_MODEL);
  //set_pev(id, pev_weaponmodel2, P_MODEL);
 
  return PLUGIN_CONTINUE;
}



public fw_setmodel(ent,const model[])
{
  // check if isn't a valid model
  if(!pev_valid(ent))
      return FMRES_IGNORED;
   
  // if isn't w_knife model
  //if(strcmp(KNIFE_W_MODEL,model) )
  //  return FMRES_IGNORED;
 
  // get ent classname
  static classname[32]
  pev(ent,pev_classname,classname,31);
 
 
  if(!strcmp(classname, "weaponbox") || !strcmp(classname, "armoury_entity") || !strcmp(classname, "grenade"))
  {
      // set model
      //engfunc(EngFunc_SetModel, ent, W_MODEL);
      return FMRES_SUPERCEDE;
  }
 
  return FMRES_IGNORED;
}
Download--> [Trebuie sa fiti inscris si conectat pentru a vedea acest link]

● JokeR ●
Admin
Admin

Mesaje : 2213
Bani : 7799
Reputatie : 43
Joined : 03/09/2011
Varsta : 20
Localizare : Tulcea
Distractii : Cs,gta,nfs fotbal,box...
Stare de spirit : Energetic

Vezi profilul utilizatorului http://www.xdmg.wow3.info

Sus In jos

Vezi subiectul anterior Vezi subiectul urmator Sus


 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum