You can try using the function made by Silvers in
[ANY] Dev Cmds
Test first using "sm_attachments <client>" and check the output, if it does work the code is based on the snipper below.
Note: You may filter other stuff like weapons etc that may be attached as well.
PHP Code:
void GetAttachments(int client, int target)
{
char classname[64];
for( int i = 1; i < 2048; i++ )
{
if( IsValidEntity(i) && HasEntProp(i, Prop_Send, "moveparent") && GetEntPropEnt(i, Prop_Send, "moveparent") == target )
{
GetEdictClassname(i, classname, sizeof(classname));
if( target <= MaxClients )
{
ReplyToCommand(client, "Attachment %N: %d %s", target, i, classname);
} else {
ReplyToCommand(client, "Attachment %d: %d %s", target, i, classname);
}
}
}
}
__________________