I am tryed to change 2 func_illusionary by their places, but failed
PHP Code:
L 05/17/2009 - 14:08:52: [change.amxx] spawned! *21
L 05/17/2009 - 14:08:52: [change.amxx] spawned! *25
L 05/17/2009 - 14:08:52: [change.amxx] found! *21
L 05/17/2009 - 14:08:52: [change.amxx] found! *25
in logs prints what both spawned, and in func_illusionary they found, but the origins doesnt changes :\
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
new Float:vOrigin1[ 3 ], Float:vOrigin2[ 3 ];
public plugin_init( ) {
register_plugin( "lololol!", "1.0", "xPaw" );
new iEntity = -1;
while( ( iEntity = find_ent_by_model( iEntity, "func_illusionary", "*21" ) ) != 0 ) {
log_amx( "found! *21" );
set_pev( iEntity, pev_origin, vOrigin2 );
}
iEntity = -1;
while( ( iEntity = find_ent_by_model( iEntity, "func_illusionary", "*25" ) ) != 0 ) {
log_amx( "found! *25" );
set_pev( iEntity, pev_origin, vOrigin1 );
}
}
public plugin_precache( )
RegisterHam( Ham_Spawn, "func_illusionary", "fwdHamSpawn_Illusionary" );
public fwdHamSpawn_Illusionary( iEntity ) {
new szModel[ 5 ];
pev( iEntity, pev_model, szModel, 4 );
if( equal( szModel, "*21" ) ) {
log_amx( "spawned! *21" );
pev( iEntity, pev_origin, vOrigin1 );
}
else if( equal( szModel, "*25" ) ) {
log_amx( "spawned! *25" );
pev( iEntity, pev_origin, vOrigin2 );
}
}
__________________