SHARE
TWEET

Untitled

a guest Nov 14th, 2019 153 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. new vModel[] = "models/v_snowball.mdl"
  5. new pModel[] = "models/p_snowball.mdl"
  6. new wModel[] = "models/w_snowball.mdl"
  7.  
  8. new wOldModel[] = "models/w_smokegrenade.mdl"
  9.  
  10. public plugin_init()
  11. {
  12.     register_forward(FM_SetModel, "forwardSetModel")
  13.     register_event("CurWeapon", "EventCurrentWeapon", "be", "1=1")
  14. }
  15.  
  16. public plugin_precache()
  17. {
  18.     precache_model(vModel)
  19.     precache_model(pModel)
  20.     precache_model(wModel)
  21. }
  22.  
  23. public EventCurrentWeapon(id)
  24. {
  25.     new szWeaponId = read_data(2)
  26.    
  27.     if(szWeaponId != CSW_SMOKEGRENADE)
  28.     return PLUGIN_CONTINUE
  29.    
  30.     set_pev(id, pev_viewmodel2, vModel)
  31.     set_pev(id, pev_weaponmodel2, pModel)
  32.    
  33.     return PLUGIN_CONTINUE
  34. }
  35.  
  36. public forwardSetModel(ent, model[])
  37. {
  38.     if(!pev_valid(ent))
  39.     return FMRES_IGNORED
  40.    
  41.     if(!equali(model, wOldModel))
  42.     return FMRES_IGNORED
  43.    
  44.     new szClassName[33]
  45.     pev(ent, pev_classname, szClassName, 32)
  46.    
  47.     if(equal(szClassName, "weaponbox") || equal(szClassName, "armoury_entity") || equal(szClassName, "grenade"))
  48.     {
  49.         engfunc(EngFunc_SetModel, ent, wModel)
  50.         return FMRES_SUPERCEDE
  51.     }
  52.     return FMRES_IGNORED
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top