Raised This Month: $ Target: $400
 0% 

How to get weapon's ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wwzw
Member
Join Date: Feb 2009
Old 12-22-2011 , 08:37   Re: How to get weapon's ID
Reply With Quote #1

But I still failed!
I can not get "your_desired_weapon_id"
Code:
register_forward(FM_SetModel,"W_Model_Hook",1)

public W_Model_Hook(ent,model[])
{
 if(!pev_valid(ent))
 {
  return FMRES_IGNORED
 }
 if(strlen(model) < 8 || model[7] != 'w' || model[8] != '_')
  return FMRES_IGNORED;
 client_print(0, print_chat, "TEST<%d>",ent)
 for (new i=0;i<load_new_weapon_num;++i) {
  if (ent == weapon_id [i]) {
    // set model
    return FMRES_SUPERCEDE;
   }
  }
 }
 return FMRES_IGNORED
}
The "ent" is not "find_ent_by_owner( -1, weaponname, id )"

When I drop the weapon, "ent" value is changing...
wwzw is offline
Reply



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 12:10.


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