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(client, false);
if(iEntAtEndPos != -1){
char sEntAtEndPosName2[128];
GetEntPropString(iEntAtEndPos, Prop_Data, "m_ModelName", sEntAtEndPosName2, 128 );
PrintToChat(client, "test %d %s", iEntAtEndPos, sEntAtEndPosName2);
}
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?