Quote:
Originally Posted by claudiuhks
Instead of using that while statement, you may loop using for through all players then check the range with entity_range instead of getting each entity classname.
What kind of error are you talking about? Infinite loop? Then try using for statement.
Segmentation fault? Make sure you are using remove_entity properly.
|
Is this okay?
PHP Code:
/* Check if player stuck in the lasermine */
static Float:originF[3], owner, iuser4, recovery;
entity_get_vector( entity , EV_VEC_origin , originF );
owner = entity_get_int( entity , EV_INT_iuser3 );
iuser4 = 1;
recovery = false;
for( new player = 1; player <= g_maxplayers; player++ )
{
if( !is_user_valid_connected( player ) || !is_user_valid_alive( player ) )
continue;
if( entity_range( player , entity ) > 7.5 )
continue;
if( owner != player && !recovery )
{
g_lm[owner]++;
colored_print( owner , "^x04[%s]^x01 Has recuperado^x03 1^x01 lasermine", TAG_PRINT );
recovery = true;
}
iuser4 = 2;
}
entity_set_int( entity , EV_INT_solid , SOLID_BBOX );
entity_set_int( entity , EV_INT_iuser4 , iuser4 );
Logs of error: Sys_error: HamFilter
What's the HamFilter problem?