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

Boolean at an origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kimilover
Junior Member
Join Date: Oct 2010
Old 06-13-2014 , 11:19   Boolean at an origin
Reply With Quote #1

Hi can i use a boolean for restricted an origin for example this.
PHP Code:
new boolused_or[32];
new 
boolused_id[32];

public 
origin(ident) {
    new 
Floators[3];
    new 
loc pev(entpev_originors);

    if (!
used_id[id] && !used_or[loc]) {
        
console_print(0"LOC ADDED!");
        
used_or[loc] = true;
        
used_id[id] = true;
    }
    else {
        
console_print(0"LOC IS USED ALREADY");
    }


with this way i can save different locs to dont use a user this origin again?
kimilover is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-13-2014 , 12:31   Re: Boolean at an origin
Reply With Quote #2

Nope.

And since origins are floats in this case, and let's say you have 5 decimals (you probably have more). On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory. But of course you can't use more than 2,147,483,647 indexes since that's how far a signed integer will reach. Even if integer is used for the origin values we're still talking 128 megabytes of memory. And I think that is a pretty small map size.

In other words, what do you really want to do?

You could create "zones" which consists of 2 origins which will set the outline of the area, comparing the player origin.
You could create entities at each location and do a search for them. But you can only create so many entities.
__________________

Last edited by Black Rose; 06-13-2014 at 12:40.
Black Rose is offline
kimilover
Junior Member
Join Date: Oct 2010
Old 06-13-2014 , 15:17   Re: Boolean at an origin
Reply With Quote #3

thx fo your awnser i want to help i have a hns blocks server and i want to use someone all blocks xp and not only one at a map... the code is this.
PHP Code:
ActionXPBlock(ident)
{
    if ( 
cs_get_user_team(id) == CS_TEAM_T )
    {
        if ( !
g_xpblock_used[id] )
        {
            new 
property[5];
            
GetProperty(ent1property);
            
hnsxp_add_user_xp(idstr_to_num(property));
            
g_xpblock_used[id] = true;
            
            
set_hudmessage(025500.010.1800.01.00.250.252);
            
show_hudmessage(id"You got %i more XP!"str_to_num(property));
        }
    }
        else
        {
            
set_hudmessage(025500.010.1800.01.00.250.252);
            
show_hudmessage(id"Only Terrorists can take XP Block!");
    }

with this when a player use one xp block he cant use another block. and i have a lot of xp blocks at a map. i want a player use all blocks once time per map.
kimilover is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 06-13-2014 , 15:29   Re: Boolean at an origin
Reply With Quote #4

Now I know nothing about HnS, but do these blocks perhaps have some kind of indexing to identify them. Because that would be a much better way of filtering the use of them.
__________________
Black Rose is offline
kimilover
Junior Member
Join Date: Oct 2010
Old 06-13-2014 , 15:38   Re: Boolean at an origin
Reply With Quote #5

when you save the blocks plugin makes a file at folder data with mapname.bcm and there it put the letter U for xp block, the origin x,y,z and the angles.... maybe i can do something with this file?
kimilover is offline
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 17:43.


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