maybe you can add some features of my special version of your plugin
PHP Code:
public Action:AdminRemovePropAim(client, args)
{
new prop = GetClientAimTarget(client, false);
if(!Entity_IsValid(prop))
{
return Plugin_Handled;
}
new String:EntName[256];
Entity_GetName(prop, EntName, sizeof(EntName));
new validProp = StrContains(EntName, "DHCPropSpawnProp");
new String:EntClassName[256];
Entity_GetClassName(prop, EntClassName, sizeof(EntClassName));
new validClass = StrContains(EntClassName, "prop_");
if(validClass > -1)
{
if(validProp > -1)
{
/* Find the client index in the string */
new String:tempInd[3];
tempInd[0] = EntName[16];
tempInd[1] = EntName[17];
tempInd[2] = EntName[18];
/* We should now have the numbers somewhere, let's find out where */
ReplaceString(tempInd, sizeof(tempInd), "_", "");
new clientIndex = StringToInt(tempInd);
new Handle:menu = CreateMenu(Handle_RemovePropAim_Menu);
decl String:buffer[5];
IntToString(prop, buffer, sizeof(buffer));
decl String:client_id[100];
decl String:client_s[100];
IntToString(clientIndex, client_s, sizeof(client_s));
KvGetString(g_kvDBSteamID, client_s, client_id, sizeof(client_id), "");
if(IsValidClient(clientIndex)) SetMenuTitle(menu, "Delete? Owner: %N [ID:%s]", clientIndex, client_id);
else SetMenuTitle(menu, "Delete? Owner: Unknown [ID:%s]", client_id);
AddMenuItem(menu, buffer, "Yes");
AddMenuItem(menu, buffer, "No");
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
LogToFile("addons/sourcemod/logs/sm_remove_props.log", "%N watched prop spawned by %s", client, client_id);
}
else
{
new Handle:menu = CreateMenu(Handle_RemovePropAim_Menu);
decl String:buffer[5];
IntToString(prop, buffer, sizeof(buffer));
SetMenuTitle(menu, "Delete? Orginal Map Prop");
AddMenuItem(menu, buffer, "Yes");
AddMenuItem(menu, buffer, "No");
LogToFile("addons/sourcemod/logs/sm_remove_props.log", "%N watched map prop", client);
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
}
return Plugin_Handled;
}
public Handle_RemovePropAim_Menu(Handle:menu, MenuAction:action, client, param2)
{
if ( action == MenuAction_Select )
{
switch (param2)
{
case 0:
{
decl String:info[5];
GetMenuItem(menu, param2, info, sizeof(info));
new prop = StringToInt(info);
new String:EntName[256];
Entity_GetName(prop, EntName, sizeof(EntName));
new validProp = StrContains(EntName, "DHCPropSpawnProp");
new String:EntClassName[256];
Entity_GetClassName(prop, EntClassName, sizeof(EntClassName));
new validClass = StrContains(EntClassName, "prop_p");
if(validClass > -1)
{
if(validProp > -1)
{
//Remove the prop
/* Find the client index in the string */
new String:tempInd[3];
tempInd[0] = EntName[15];
tempInd[1] = EntName[16];
tempInd[2] = EntName[17];
/* We should now have the numbers somewhere, let's find out where */
ReplaceString(tempInd, sizeof(tempInd), "_", "");
new clientIndex = StringToInt(tempInd);
AcceptEntityInput(prop, "kill");
decl String:client_id[100];
decl String:client_s[100];
IntToString(clientIndex, client_s, sizeof(client_s));
KvGetString(g_kvDBSteamID, client_s, client_id, sizeof(client_id), "");
PrintToConsole(client, "Delted Prop_ID: %d, Owner was Steam_ID: %s", prop, client_id);
LogToFile("addons/sourcemod/logs/sm_remove_props.log", "%N removed prop spawned by %s", client, client_id);
}
else
{
AcceptEntityInput(prop, "kill");
PrintToConsole(client, "Delted Prop_ID: %d, Orginal Map Entity", prop);
LogToFile("addons/sourcemod/logs/sm_remove_props.log", "%N removed map prop", client);
}
}
}
case 1:
{
}
}
}
}