Raised This Month: $51 Target: $400
 12% 

[L4D2] Model name to Item name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kahdeg
Junior Member
Join Date: Oct 2021
Old 03-16-2024 , 06:57   [L4D2] Model name to Item name
Reply With Quote #1

Hi, i was trying to make a simple pinging plugins.
Here is my code that do the pointing and getting the pointed at Entity:
PHP Code:
    int iEntAtEndPos;
    
iEntAtEndPos GetClientAimTarget(clientfalse);
    if(
iEntAtEndPos != -1){
        
char sEntAtEndPosName2[128];
        
GetEntPropString(iEntAtEndPosProp_Data"m_ModelName"sEntAtEndPosName2128 );
        
PrintToChat(client"test %d %s"iEntAtEndPossEntAtEndPosName2);
    } 
the output is:
Code:
test 3 models/survivors/survivor_mechanic.mdl
test 687 models/w_models/weapons/w_pistol_B.mdl
test 608 models/weapons/melee/w_fireaxe.mdl
test 608 models/weapons/melee/w_fireaxe.mdl
test 2 models/survivors/survivor_producer.mdl
test 3 models/survivors/survivor_mechanic.mdl
test 686 models/w_models/weapons/w_eq_Medkit.mdl
test 608 models/weapons/melee/w_fireaxe.mdl
test 609 models/weapons/melee/w_fireaxe.mdl
test 687 models/w_models/weapons/w_pistol_B.mdl
test 781 models/weapons/melee/w_crowbar.mdl
test 4 models/survivors/survivor_coach.mdl
test 415 models/props_urban/plastic_chair001.mdl
I want to map and filter only stuff like weapon and medkit, pill, ... things that player can pickup.
Is there a list of model or some standard function that do that?

Last edited by kahdeg; 03-16-2024 at 06:58.
kahdeg is offline
little_froy
Senior Member
Join Date: May 2021
Old 03-16-2024 , 08:24   Re: [L4D2] Model name to Item name
Reply With Quote #2

why don't you use classname? https://sm.alliedmods.net/new-api/en...ntityClassname
little_froy is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-17-2024 , 09:09   Re: [L4D2] Model name to Item name
Reply With Quote #3

Check plugin and CreateStringMap https://github.com/fbef0102/L4D2-Plu...2_item_hint.sp
__________________
Marttt 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 06:04.


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