Raised This Month: $ Target: $400
 0% 

Solved Limited Map Zone


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-29-2018 , 12:45   Re: Limited Map Zone
Reply With Quote #6

I made something but it slaps me when I'm close to the beams, like, I'm within the radius but stay close to them, it slaps me. Also when I'm in the radius but in the sky.

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

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

new 
g_iSprite;

public 
plugin_init( )
{
    
register_clcmd"say /sphere""OnSphere" );
    
register_clcmd"say /remove""OnRemove" );
}

public 
plugin_precache( ) 

    
g_iSprite precache_modelg_szSprite ); 



public 
OnSphereid )
{
    
set_task1.0"RenewSphere"666, .flags="b" );
}

public 
OnRemoveid )
{
    
remove_task666 );
}

public 
RenewSphere( )
{
    new 
Float:fOrigin_Center[3] = {-8.5, -0.0, -487.4};
    const 
divides 128
    new 
Float:fOrigin[3];
    new 
Float:fAngle[3], Float:AngleMulScalar = (360.0 divides), Float:fVector[3];
    const 
Float:Radius 2000.0;
    
    for(new 
idividesi++)
    {
        
angle_vector(fAngleANGLEVECTOR_RIGHTfVector);
        
xs_vec_mul_scalar(fVectorRadiusfVector);
        
xs_vec_add(fOrigin_CenterfVectorfOrigin);
        
        
CreateBeamfOrigin );
        
        
fAngle[1] += AngleMulScalar;
    }

    
// check if other players are out and slap them.
    
new ent = -1players[32], pnumignore[33];
    while( (
ent engfunc(EngFunc_FindEntityInSphereentfOrigin_CenterRadius)) > 0)
    {
        if(
is_user_alive(ent))
        {
            
ignore[ent] = true;
        }
    }

    
get_players(players,pnum,"a")
    for(new 
i,playerpnumi++)
    {
        
player players[i];
        if(
ignore[player]) continue;

        
user_slap(playerrandom_num(2,10));
    }  
}

CreateBeamFloat:fOrigin] )
{  
    
message_beginMSG_BROADCASTSVC_TEMPENTITY )
    
write_byteTE_BEAMPOINTS )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoordfOrigin] )
    
engfuncEngFunc_WriteCoord4000.0 )
    
write_shortg_iSprite 
    
write_byte
    
write_byte
    
write_byte30 
    
write_byte60 
    
write_byte
    
write_byte255 )
    
write_byte)
    
write_byte)
    
write_byte127 )
    
write_byte)
    
message_end( );

__________________

Last edited by edon1337; 07-29-2018 at 13:21.
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