Raised This Month: $ Target: $400
 0% 

set tricky origin for 2 ents


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 10-21-2014 , 21:03   set tricky origin for 2 ents
Reply With Quote #1

PHP Code:
                          new ent = -1,count                         
                          
while((ent find_ent_by_class(entmedalclass)))
                          {
                                if(
owner(ent) != id) continue
                
                                new 
FloatplayerOrigin];
                                
pevidpev_originplayerOrigin ); 
                   
                                
count++
                                
playerOrigin] += 45.0;
                                if(
count++ > 1)  playerOrigin] += 85.0    // xample
                 
                            // how to change origin for FIRST ent (which += 45 we set before)
                 
                                
engfuncEngFunc_SetOriginplayerBarplayerOrigin );              
                          } 
What I want If he has 2 ents I want change origin for BOTH, previous and current


PHP Code:
if(count == 1playerOrigin] += 45.0;
if(
count == 2)
{
   
// SET FIRST ENT TO
    
playerOrigin] -= 20.0;
    
playerOrigin] += 45.0;

    
// SET SECOND ENT TO
  
    
playerOrigin] += 20.0;
    
playerOrigin] += 45.0;


its stupid to find first ent id again after loop end ......
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 10-21-2014 at 21:06.
avril-lavigne is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:36.


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