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(entindex, Prop_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
__________________