View Single Post
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