Raised This Month: $32 Target: $400
 8% 

Rectangular Room Max/Min Calculator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-29-2008 , 04:08   Rectangular Room Max/Min Calculator
Reply With Quote #1

Update: URL to PHP script is no longer active.

This is a PHP script that simply calcuates the Max's and Min's of a rectangular room. It's for lazy people like myself. The algorithm is ridiculously simple, as Chronic says - and it is. You may find it useful, though.

Note: I didn't add error checking, so, if you make any mistakes, it's on you.

Example usage in an AMXX plugin:
PHP Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    
register_plugin"Max/Min Usage Example" "1.0" "v3x" )

    
register_clcmd"say /test" "ClCmd_SayTest" )
}

new 
Float:g_fMaxs[3] = { -279.0 , -635.0 , -78.0 }
new 
Float:g_fMins[3] = { -728.0 , -1005.0 , -174.0 }

public 
ClCmd_SayTestid )
{
    if( !
is_user_aliveid ) )
        return 
PLUGIN_CONTINUE

    
new Float:fOrigin[3]
    
pevid pev_origin fOrigin )

    if(
    
fOrigin[0] <= g_fMaxs[0] &&
    
fOrigin[1] <= g_fMaxs[1] &&    
    
fOrigin[2] <= g_fMaxs[2] &&
    
fOrigin[0] >= g_fMins[0] &&
    
fOrigin[1] >= g_fMins[1] &&
    
fOrigin[2] >= g_fMins[2] )
    {
        
client_printid print_chat "You are within the rectangle" )
    }
    else
    {
        
client_printid print_chat "You are not within the rectangle" )
    }

    return 
PLUGIN_CONTINUE

Attached Files
File Type: sma Get Plugin or Get Source (max_min_example.sma - 1384 views - 819 Bytes)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.

Last edited by v3x; 08-12-2011 at 12:51.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-29-2008 , 13:40   Re: Rectangular Room Max/Min Calculator
Reply With Quote #2

Doesn't a rectangular room have 8 corners?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-29-2008 , 18:54   Re: Rectangular Room Max/Min Calculator
Reply With Quote #3

Yeah but that's what the height checking is for
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-29-2008 , 20:09   Re: Rectangular Room Max/Min Calculator
Reply With Quote #4

Well I'm confused.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-05-2008 , 20:53   Re: Rectangular Room Max/Min Calculator
Reply With Quote #5

edit: nevermind
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-13-2009 , 12:40   Re: Rectangular Room Max/Min Calculator
Reply With Quote #6

Code:
Not Found

The requested URL /origin_mam_convertor.php was not found on this server.
v3x reupload it please ;)
__________________
xPaw is offline
Old 09-04-2011, 04:39
dl.play
This message has been deleted by xPaw. Reason: Spam.
Old 09-05-2011, 05:21
johnnyvh
This message has been deleted by xPaw. Reason: Spam.
Reply


Thread Tools
Display Modes

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 20:55.


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