Raised This Month: $51 Target: $400
 12% 

[SOLVED] [CSS] Entity Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 04-07-2012 , 18:36   [SOLVED] [CSS] Entity Problem
Reply With Quote #1

hello,

I'm looking to delete a button on a certain map, i'm sure of the coordinate of the button, so I tested a code, but It don't work ;X

PHP Code:
public OnPluginStart()
{
    
HookEvent("round_start"Event_Start);    
}

public 
Action:Event_Start(Handle:event,const String:name[],bool:dontBroadcast)
{
    
CreateTimer(2.0,delete);
}

public 
Action:delete(Handle:timer)
{
    new 
entindex = -1;
    while ((
entindex FindEntityByClassname(entindex"func_button")) != -1)
    {
        if(
IsValidEntity(entindex))
        {
            new 
Float:pos[3];
            
GetEntPropVector(entindexProp_Send"m_vecOrigin"pos);
            if(
pos[0] == 465.500000 && pos[1] == -4.010009 && pos[2] == -42.000000)
            {
                
PrintToChatAll("\x04Button: %i",entindex);
                
AcceptEntityInput(entindex"Kill");
                
PrintToChatAll("\x04Button: %i deleted",entindex);
            }
        }
    }

I put a delay of 2 seconds because the button is attached to a prop that is falling at the start of the round.

the code doesn't work, can you have a look ?

thx
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 04-08-2012 at 19:05.
Razmo51 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode