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

Hey


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 01-11-2015 , 05:29   Hey
Reply With Quote #1

How can I compare a player's coordinates to some already defined coordinates?
Kazalu is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-11-2015 , 06:08   Re: Hey
Reply With Quote #2

Maybe this code can help:

https://forums.alliedmods.net/showpo...&postcount=551
zmd94 is offline
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 01-11-2015 , 06:15   Re: Hey
Reply With Quote #3

Did not really help tbh
Kazalu is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 01-11-2015 , 07:33   Re: Hey
Reply With Quote #4

Lets say i want to make a "cube zone" in my map by coords, and when players enter inside of that "cube zone", it execs a command. Thats what he meant.
Syturi0 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-11-2015 , 08:52   Re: Hey
Reply With Quote #5

Use this to check if an ent is inside of another ent.

iFirstIndex should be the player index if it's about your exmaple and iSecondIndex the cube zone index.
PHP Code:
stock boolEntInsideEntiFirstIndexiSecondIndex)
{
    new  
FloatfEntMin    ];  peviFirstIndexpev_absminfEntMin )
    new  
FloatfEntMax    ];  peviFirstIndexpev_absmaxfEntMax )
    new  
FloatfTargetMin    ];  peviSecondIndexpev_absminfTargetMin )
    new  
FloatfTargetMax    ];  peviSecondIndexpev_absmaxfTargetMax )
    new  
Floatv_fDistance    ]

    for( new 
i3i++ )
    {
        if( 
fEntMin] > fTargetMax] )
        {
            
v_fDistance] = fEntMin] - fTargetMax]
        }
        
        else if( 
fTargetMin] > fEntMax] )
        {
            
v_fDistance] = fTargetMin] - fEntMax]
        }
    }
    
    if( 
vector_lengthv_fDistance ) )
    {
        return 
false
    
}
    
    else
    {
        return 
true 
    
}
    
    return 
false

__________________
HamletEagle is online now
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 01-11-2015 , 10:44   Re: Hey
Reply With Quote #6

What if I want to compare the object's coordinates with some numeral coordinates?

Like coord[ 1 ] <= 529345095 bla bla bla
Kazalu is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-11-2015 , 14:09   Re: Hey
Reply With Quote #7

Quote:
Originally Posted by Kazalu View Post
What if I want to compare the object's coordinates with some numeral coordinates?

Like coord[ 1 ] <= 529345095 bla bla bla
Then get them and compare.
__________________
HamletEagle is online now
Kazalu
Senior Member
Join Date: Dec 2013
Location: Romania
Old 01-12-2015 , 06:49   Re: Hey
Reply With Quote #8

I did, seems to be bugged.I print out the coords.Then copy paste them into the code.I even take some error margins to be sure.Not working at all.
Kazalu is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-12-2015 , 12:45   Re: Hey
Reply With Quote #9

Show us what you did, in this context words are = 0.
__________________
HamletEagle is online now
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 01-12-2015 , 13:07   Re: Hey
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
Show us what you did, in this context words are = 0.
PHP Code:
public Messagecount )
{
    new 
Players[32
    new 
playerCountiid 
    get_players
(PlayersplayerCount"c"
    for (
i=0i<playerCounti++) 
    {
        
id Players[i
        
now get_gametime()
        
show floatroundCOOLDOWN ) - floatroundnow ) + floatroundthen )
        new 
FloatvecOrigin]
        
pev(idpev_originvecOrigin)
        if( 
vecOrigin] >= -1012797890 && vecOrigin] <= -1005540167 && vecOrigin] >=  1161517179 && vecOrigin] <= 1162705220 && vecOrigin] >= 1142000000 && vecOrigin] <= 1143000000 )
        {
            
client_print(idprint_center"%d"show )
        }
    }

Syturi0 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 09:17.


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