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=40299)

hmrsmpsn 06-25-2006 21:35

models
 
im trying to make a model changer for cs andi want the plugin to change the model for the machinegun. i need help on how to do this!

k007 06-25-2006 22:42

Re: models
 
Code:
#include <amxmodx> #include <engine> #include <fun> new M249_MODEL_NAME[64] = "models/model name.mdl" //your model DIR public plugin_init(){     register_plugin("machine gun","0.1","k007")     register_event("WeapPickup","checkModel","b","1=19")          register_event("CurWeapon","checkWeapon","be","1=1")     } public plugin_precache(){     precache_model(M249_MODEL_NAME)     return PLUGIN_CONTINUE } public checkModel(id){     if (!is_user_alive(id)){         return PLUGIN_CONTINUE     }     entity_set_string(id, EV_SZ_viewmodel, M249_MODEL_NAME)             new iCurrent     iCurrent = find_ent_by_class(-1,"weapon_M249")     while(iCurrent != 0) {         iCurrent = find_ent_by_class(iCurrent,"weapon_M249")     }     return PLUGIN_HANDLED } public checkWeapon(id){     new plrClip, plrAmmo, plrWeap[32]     new plrWeapId     plrWeapId = get_user_weapon(id, plrClip, plrAmmo)         if (plrWeapId == CSW_M249){         checkModel(id)     }     else {                 return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }


All times are GMT -4. The time now is 08:04.

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