View Single Post
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 10-15-2012 , 22:26   Re: [ANY] OM Prop Spawn - Updated 27/6/2011
Reply With Quote #56

maybe you can add some features of my special version of your plugin
PHP Code:
public Action:AdminRemovePropAim(clientargs)
{
    new 
prop GetClientAimTarget(clientfalse);
    
    if(!
Entity_IsValid(prop)) 
    {
        return 
Plugin_Handled;
    }
    
    new 
String:EntName[256];
    
Entity_GetName(propEntNamesizeof(EntName));
    new 
validProp StrContains(EntName"DHCPropSpawnProp");
    
    new 
String:EntClassName[256];
    
Entity_GetClassName(propEntClassNamesizeof(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(tempIndsizeof(tempInd), "_""");
            
            new 
clientIndex StringToInt(tempInd);
            new 
Handle:menu CreateMenu(Handle_RemovePropAim_Menu);
            
decl String:buffer[5];
            
            
IntToString(propbuffersizeof(buffer));
            
            
decl String:client_id[100];
            
decl String:client_s[100];
            
IntToString(clientIndexclient_ssizeof(client_s));
            
            
KvGetString(g_kvDBSteamIDclient_sclient_idsizeof(client_id), "");
        
            if(
IsValidClient(clientIndex)) SetMenuTitle(menu"Delete? Owner: %N [ID:%s]"clientIndexclient_id);
            else 
SetMenuTitle(menu"Delete? Owner: Unknown [ID:%s]"client_id);
            
            
AddMenuItem(menubuffer"Yes");
            
AddMenuItem(menubuffer"No");
            
            
SetMenuExitButton(menutrue);
            
DisplayMenu(menuclientMENU_TIME_FOREVER);
            
LogToFile("addons/sourcemod/logs/sm_remove_props.log""%N watched prop spawned by %s"clientclient_id);
        }
        else
        {
            new 
Handle:menu CreateMenu(Handle_RemovePropAim_Menu);
            
decl String:buffer[5];
            
IntToString(propbuffersizeof(buffer));
            
SetMenuTitle(menu"Delete? Orginal Map Prop");
            
AddMenuItem(menubuffer"Yes");
            
AddMenuItem(menubuffer"No");
            
LogToFile("addons/sourcemod/logs/sm_remove_props.log""%N watched map prop"client);
            
            
SetMenuExitButton(menutrue);
            
DisplayMenu(menuclientMENU_TIME_FOREVER);
        }
        
    }
    
    return 
Plugin_Handled;
}
 
public 
Handle_RemovePropAim_Menu(Handle:menuMenuAction:actionclientparam2)
{
    if ( 
action == MenuAction_Select )
    {
        switch (
param2)
        {
            case 
0:
            {
                
decl String:info[5];
                
GetMenuItem(menuparam2infosizeof(info));
                new 
prop StringToInt(info);
                
                new 
String:EntName[256];
                
Entity_GetName(propEntNamesizeof(EntName));
                new 
validProp StrContains(EntName"DHCPropSpawnProp");
                
                new 
String:EntClassName[256];
                
Entity_GetClassName(propEntClassNamesizeof(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(tempIndsizeof(tempInd), "_""");
                        
                        new 
clientIndex StringToInt(tempInd);
                        
AcceptEntityInput(prop"kill");
                        
                        
decl String:client_id[100];
                        
decl String:client_s[100];
                        
IntToString(clientIndexclient_ssizeof(client_s));
                        
                        
KvGetString(g_kvDBSteamIDclient_sclient_idsizeof(client_id), "");
                        
                        
PrintToConsole(client"Delted Prop_ID: %d, Owner was Steam_ID: %s"propclient_id);
                        
LogToFile("addons/sourcemod/logs/sm_remove_props.log""%N removed prop spawned by %s"clientclient_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:
            {
                
            }
        }
    }


Last edited by zipcore; 10-15-2012 at 22:28.
zipcore is offline