PHP Code:
#include < amxmodx >
#include < fakemeta >
new const g_szEntityClass[] = "MyEntity";
new g_iEntity;
public plugin_init()
{
register_plugin( "Using FM_Think", "v1.0", "@.SizNeR" );
register_forward( FM_Think, "FwThink" );
CmdCreateEntity();
}
public FwThink( iEntity )
{
if ( !pev_valid( iEntity ) )
return 1;
static szEntityClass[ 32 ];
pev( iEntity, pev_classname, szEntityClass, charsmax( szEntityClass ) );
if ( !equali( szEntityClass, g_szEntityClass ) )
{
CmdSetThink( g_iEntity, 1.0 );
return 1;
}
new iPlayers[ 32 ], iCtCount, iTerrorCount;
get_players( iPlayers, iCtCount, "ceh", "CT" );
get_players( iPlayers, iTerrorCount, "ceh", "TERRORIST" );
if ( ( iCtCount <= 0 && iTerrorCount >= 1 ) || ( iCtCount <= 1 && iTerrorCount >= 10 ) || ( iCtCount <= 2 && iTerrorCount >= 15 ) || ( iCtCount <= 3 && iTerrorCount >= 20 ) )
{
MyPublic();
return 1;
}
CmdSetThink( g_iEntity, 1.0 );
return 1;
}
public MyPublic()
{
log_amx( "On My Public." );
}
stock CmdCreateEntity()
{
g_iEntity = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
set_pev( g_iEntity, pev_classname, g_szEntityClass );
CmdSetThink( g_iEntity, 1.0 );
}
stock CmdSetThink( iEntity, Float:flTime )
{
set_pev( iEntity, pev_nextthink, get_gametime() + flTime );
}
Help please?