Raised This Month: $ Target: $400
 0% 

Custom Weapon Drop & Pickup


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 06-05-2013 , 03:58   Re: Custom Weapon Drop
Reply With Quote #5

ive made a slight edit so i can use the const g_weaponModels[][] in more then one way..

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #define PLUGIN "Golden Weapons" #define VERSION "1.0" #define AUTHOR "Blizzard" new g_weaponModels[][] = {     "ak47",     "m4a1",     "deagle" }; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("CurWeapon","event_curweapon","be", "1=1");         register_forward(FM_SetModel, "fw_SetModel" );     } public plugin_precache() {         for(new i = 0; i < sizeof g_weaponModels; i++)     {         static modelPatch[124];         formatex(modelPatch, charsmax(modelPatch), "models/golden/v_%s.mdl", g_weaponModels[i]);         precache_model(modelPatch);         formatex(modelPatch, charsmax(modelPatch), "models/golden/p_%s.mdl", g_weaponModels[i]);         precache_model(modelPatch);         formatex(modelPatch, charsmax(modelPatch), "models/golden/w_%s.mdl", g_weaponModels[i]);         precache_model(modelPatch);     } } public event_curweapon(id) {     new clip, ammo, weapon = get_user_weapon(id, clip, ammo);         if(weapon == CSW_AK47) {         set_pev(id, pev_viewmodel2, "models/golden/v_ak47.mdl");         set_pev(id, pev_weaponmodel2, "models/golden/p_ak47.mdl");                 if(pev(id, pev_button) & IN_ATTACK) {             set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0});         }     }     if(weapon == CSW_M4A1) {         set_pev(id, pev_viewmodel2, "models/golden/v_m4a1.mdl");         set_pev(id, pev_weaponmodel2, "models/golden/p_m4a1.mdl");                 if(pev(id, pev_button) & IN_ATTACK)  {               set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0});         }     }     if(weapon == CSW_DEAGLE) {         set_pev(id, pev_viewmodel2, "models/golden/v_deagle.mdl");         set_pev(id, pev_weaponmodel2, "models/golden/p_deagle.mdl");                 if(pev(id, pev_button) & IN_ATTACK) {               set_pev(id, pev_punchangle, Float:{0.0, 0.0, 0.0});         }     }     return PLUGIN_CONTINUE; } public fw_SetModel(ent, const model[]) {     for(new i = 0; i < sizeof g_weaponModels; i++) {         static w_model[ 32 ];         formatex( w_model, charsmax( w_model ), "w_%s.mdl", g_weaponModels[ i ] );         if(equal(model[7], w_model)) {             static newModel[32];             formatex(newModel, charsmax(newModel), "models/golden/%s", w_model);             engfunc(EngFunc_SetModel, ent, newModel);             return FMRES_SUPERCEDE;         }     }     return FMRES_IGNORED; }

is there anyway when you pickup a weapon in WeapPickup event to check the modelname? and match it to a custom one? to then auto set true on a bool on that player?
__________________
Blizzard_87 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:27.


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