AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Doesnt change origin of func_* (https://forums.alliedmods.net/showthread.php?t=92600)

xPaw 05-17-2009 07:12

Doesnt change origin of func_*
 
I am tryed to change 2 func_illusionary by their places, but failed

PHP Code:

L 05/17/2009 14:08:52: [change.amxxspawned! *21
L 05
/17/2009 14:08:52: [change.amxxspawned! *25
L 05
/17/2009 14:08:52: [change.amxxfound! *21
L 05
/17/2009 14:08:52: [change.amxxfound! *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], Float:vOrigin2];

public 
plugin_init( ) {
    
register_plugin"lololol!""1.0""xPaw" );
    
    new 
iEntity = -1;
    while( ( 
iEntity find_ent_by_modeliEntity"func_illusionary""*21" ) ) != ) {
        
log_amx"found! *21" );
        
set_peviEntitypev_originvOrigin2 );
    }
    
    
iEntity = -1;
    while( ( 
iEntity find_ent_by_modeliEntity"func_illusionary""*25" ) ) != ) {
        
log_amx"found! *25" );
        
set_peviEntitypev_originvOrigin1 );
    }
}

public 
plugin_precache( )
    
RegisterHamHam_Spawn"func_illusionary""fwdHamSpawn_Illusionary" );

public 
fwdHamSpawn_IllusionaryiEntity ) {
    new 
szModel];
    
peviEntitypev_modelszModel);
    
    if( 
equalszModel"*21" ) ) {
        
log_amx"spawned! *21" );
        
peviEntitypev_originvOrigin1 );
    }
    else if( 
equalszModel"*25" ) ) {
        
log_amx"spawned! *25" );
        
peviEntitypev_originvOrigin2 );
    }



Dr.G 05-17-2009 07:20

Re: Doesnt change origin of func_*
 
your origins are empty

xPaw 05-17-2009 07:49

Re: Doesnt change origin of func_*
 
Why?O_o

Dr.G 05-17-2009 08:15

Re: Doesnt change origin of func_*
 
well you gotta set a new origin right? Where is the new origin(s)?

xPaw 05-17-2009 08:30

Re: Doesnt change origin of func_*
 
Watch into fwdHamSpawn_Illusionary

Dr.G 05-17-2009 08:58

Re: Doesnt change origin of func_*
 
yea you get the the origins and put them into vOrigin1 and 2. after that you set them to them to vOrigin1 and 2. now where is the new origins? :)

xPaw 05-17-2009 09:11

Re: Doesnt change origin of func_*
 
in global variables...

Dr.G 05-17-2009 09:18

Re: Doesnt change origin of func_*
 
do a print of what you think is the new origin and the old/original origin then.

xPaw 05-17-2009 09:38

Re: Doesnt change origin of func_*
 
Code:

L 05/17/2009 - 16:37:29: [lol.amxx] spawned! *21 at origin: 0.0 0.0 0.0
L 05/17/2009 - 16:37:29: [lol.amxx] spawned! *25 at origin: 0.0 0.0 0.0


joaquimandrade 05-17-2009 09:39

Re: Doesnt change origin of func_*
 
You guys are not understanding xpaw's question. He want to trade two entities origins. The problem is that they don't have it defined at spawn.


All times are GMT -4. The time now is 01:29.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.