What's wrong with the code below :-
I registered a command /destroy to destroy dispenser but it's not working whats wrong ?
PHP Code:
public destroy(iOwner)
{
new iEnt = FM_NULLENT;
new iOwner = pev( iEnt, pev_iuser2 );
bDispenserBuild[ iOwner ] = false;
set_pev( iEnt, pev_flags, pev( iEnt, pev_flags ) | FL_KILLME );
}
}
/*
~~~~~~~~~~~~~~~~~~~~~~~
Here is the stock
~~~~~~~~~~~~~~~~~~~~~~~
*/
stock UTIL_DestroyDispensers( )
{
new iEnt = FM_NULLENT;
while( ( iEnt = find_ent_by_class( iEnt, gDispenserClassname ) ) )
{
new iOwner = pev( iEnt, pev_iuser2 );
bDispenserBuild[ iOwner ] = false;
set_pev( iEnt, pev_flags, pev( iEnt, pev_flags ) | FL_KILLME );
}
}
someone please help.. thanks.