Raised This Month: $51 Target: $400
 12% 

set tricky origin for 2 ents


Post New Thread Reply   
 
Thread Tools Display Modes
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
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 10-22-2014 , 01:29   Re: set tricky origin for 2 ents
Reply With Quote #2

What about a global var?
RateX is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-22-2014 , 10:12   Re: set tricky origin for 2 ents
Reply With Quote #3

No idea what you're trying do to.
Plus, you don't even check whether or not the entity's owner is in-game (is_user_connected), or out of range (< 1 or > maxPlayers).
__________________

Last edited by claudiuhks; 10-22-2014 at 10:13.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 10-23-2014 , 08:10   Re: set tricky origin for 2 ents
Reply With Quote #4

PHP Code:
new firstEnt find_ent_by_class(...);
// Get firstEnt origin.

for (ent find_ent_by_class(...))
{
    
// Set ent origin.
    // Set firstEnt origin.

__________________
hleV is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 10-23-2014 , 10:18   Re: set tricky origin for 2 ents
Reply With Quote #5

edit



they both calculated in prethink
Im getting position of player [0] += 45.0
then put spr first and scond time -30 left.

I cant change first sprite position because set origin set it first always
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 10-23-2014 at 12:10.
avril-lavigne is offline
Reply



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 21:45.


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