I need to get the distance from the tr spawn and any other door.
PHP Code:
new b_Base[101];
public Spawns_To_Edit( )
{
// Entidades
new entity, g_iBomb, Float:g_Var, g_iCount;
// Colocar
g_Var = float(get_pcvar_num(g_iRadius))
// Origens
new Float:DROrigin[3];
new Float:PLOrigin[3];
while ((entity = find_ent_by_class(g_iBomb, "info_player_deathmatch")))
{
pev( entity, pev_origin, DROrigin )
while ((g_iBomb = find_ent_by_class(entity, "func_door")))
{
pev( g_iBomb , pev_origin, DROrigin )
if ( get_distance_f( DROrigin, PLOrigin ) <= g_Var )
{
for(new i=1;i <= 100;i++)
{
if( !g_Base[i] && fnEntCount(g_iBomb ) == 0 )
{
g_Base[i] = g_iBomb;
g_iCount++;
}
}
}
}
}
client_print(0, print_chat, "[Debug] %d", g_iCount);
}
fnEntCount(entity)
{
new iCount = 0
for(new i=1;i <= 100;i++)
{
if( g_Base[i] == entity )
iCount++
}
return iCount
}
Tnx
__________________