Raised This Month: $ Target: $400
 0% 

Solved Get weapon's entity id, from weapon ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-09-2020 , 12:52   Re: Get weapon's entity id, from weapon ID
Reply With Quote #1

PHP Code:
stock pf_find_weapon_ent_id(idCSW_ID)
{
    static 
entszClassname[24]; ent = -1;
    
get_weaponname(CSW_IDszClassnamecharsmax(szClassname));
    
    while ((
ent find_ent_by_class(entszClassname)) > && entity_get_edict(entEV_ENT_owner) != id) { }
    return 
ent;

it will be more common sense and faster to use..

Code:
stock pf_find_weapon_ent_id(id, CSW_ID) {     static szClassname[24];     get_weaponname(CSW_ID, szClassname, charsmax(szClassname));     return find_ent_by_owner(-1, szClassname, id); }

since i forgot about the find_ent_by_owner native.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 12-11-2020 at 15:43.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 20:26.


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