Raised This Month: $ Target: $400
 0% 

Solved Limited Map Zone


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-29-2018 , 08:59   Limited Map Zone
Reply With Quote #1

I'm using this modified code originally created by Natsheh, to create a zone that would slap users who are outside of it, but it just kills me instantly as soon as I type /create.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <xs>

new const g_szSprite[ ] = "sprites/laserbeam.spr";

new 
g_iSprite;

public 
plugin_init( )
{    
    
register_clcmd"say /create""@CreateZone" );
}

public 
plugin_precache( ) 

    
g_iSprite precache_modelg_szSprite ); 


@
CreateZoneid )
{
    new 
Float:fOrigin_Center]
    
pevidpev_originfOrigin_Center );
    
    const 
iDivide 128;
    new 
Float:fOrigin]
    
//new Float:fAngle[ 3 ], Float:AngleMulScalar = ( 360.0 / iDivide ), Float:fVector[ 3 ];
    //const Float:iRadius = 500.0;
    
    
new Array:aTempArray ArrayCreatesizeof fOrigin);
    
    for( new 
iiDividei++ )
    {
        
//angle_vector( fAngle, ANGLEVECTOR_RIGHT, fVector );
        //xs_vec_mul_scalar( fVector, iRadius, fVector );
        //xs_vec_add( fOrigin_Center, fVector, fOrigin );
        
        
ArrayPushArrayaTempArrayfOrigin );
        
        
//fAngle[ 1 ] += AngleMulScalar;
        
CreateWallfOrigin /*,fAngle*/ );
    }
    
    new 
szPlayers32 ], iNumiTempID;
    
get_playersszPlayersiNum"ach" );
    
    for( new 
iFloat:fUserOrigin]; iNumi++ )
    {
        
iTempID szPlayers];
        
peviTempIDpev_originfUserOrigin );
        
        for( new 
xArraySizeaTempArray ); x++ )
        {
            
ArrayGetArrayaTempArrayxfOrigin );
            
            if( 
fUserOrigin] < fOrigin] || fUserOrigin] < fOrigin] ||
                    
fUserOrigin] > fOrigin] || fUserOrigin] < fOrigin] )
            {
                
user_slapiTempIDrandom_num210 ) )
            }
        }
    }
    
    
ArrayDestroyaTempArray );
}

CreateWallFloat:fOrigin]/*, Float:fAngle[ 3 ]*/)
{  
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byteTE_BEAMPOINTS )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordGetMaxHeight( ) )
    
write_shortg_iSprite 
    
write_byte
    
write_byte
    
write_byte10 
    
write_byte60 
    
write_byte
    
write_byte255 )
    
write_byte)
    
write_byte)
    
write_byte127 )
    
write_byte)
    
message_end( );
}  

Float:GetMaxHeight( )

    new  
pcCurrent;
    new 
Float:fStartPoint];
    
    while ( ( 
engfuncEngFunc_PointContents fStartPoint ) == CONTENTS_EMPTY ) || (  engfuncEngFunc_PointContents fStartPoint ) == CONTENTS_SOLID ) )
    {
        
fStartPoint] += 5.0
    }
    
    
pcCurrent engfuncEngFunc_PointContents fStartPoint ); 

    if( 
pcCurrent == CONTENTS_SKY )
    {
        return 
fStartPoint] -= 20.0;
    }
    return 
0.0

__________________

Last edited by edon1337; 07-29-2018 at 17:04.
edon1337 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 12:16.


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