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

Fix for paintball plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 06-14-2015 , 23:44   Fix for paintball plugin
Reply With Quote #1

Hello, anyone can help to fix this plugin? please

This plugin works only with pistols (without deagle) all SMG and all SHOUTGUNS, with RIFLES and MACHINE GUN doesn't work and i can't fix it by myself

PHP Code:
#include <amxmodx>
#include <engine>

#pragma semicolon 1

#define MAX_COLORS 9

new g_paintSprite[2][] = { "sprites/bhit.spr""sprites/richo1.spr" };
new 
g_paintColors[MAX_COLORS][3] = {
    { 
255255255 },  // white
    
2550},   // red
    
0255},   // green
    
00255 },   // blue
    
255255},    // yellow
    
2550255 },    // magenta
    
0255255 },    // cyan
    
25520147 },   // pink
    
255165}     // orange
};

new 
lastwpn[33], lastammo[33];
new 
pcvar_pbpcvar_pb_rndcol;
new 
bool:paintballbool:pb_rndcolor;

public 
plugin_init( )
{
    
register_plugin"Paint Ball""0.21""KRoTaL" );
    
pcvar_pb register_cvar"paintball""1" );
    
pcvar_pb_rndcol register_cvar"paintball_randomcolor""1" );
    
register_event"CurWeapon""make_paint""be");
    
register_logevent"new_round"2"0=World triggered""1=Round_Start" );
}

public 
plugin_precache( )
{
    
precache_model"sprites/bhit.spr" );
    
precache_model"sprites/richo1.spr" );
}

stock worldInVicinityFloat:origin[3] )
{
    new 
ent find_ent_in_sphere( -1origin4.0 );
    while( 
ent )
    {
        if( 
entity_get_floatentEV_FL_health ) > 0.0 || entity_get_floatentEV_FL_takedamage ) > 0.0 )
            return 
0;
        
ent find_ent_in_sphereentorigin4.0 );
    }

    new 
Float:traceEnds[8][3], Float:traceHit[3], hitEnt;

    
traceEnds[0][0] = origin[0] - 2.0;
    
traceEnds[0][1] = origin[1] - 2.0;
    
traceEnds[0][2] = origin[2] - 2.0;

    
traceEnds[1][0] = origin[0] - 2.0;
    
traceEnds[1][1] = origin[1] - 2.0;
    
traceEnds[1][2] = origin[2] + 2.0;

    
traceEnds[2][0] = origin[0] + 2.0;
    
traceEnds[2][1] = origin[1] - 2.0;
    
traceEnds[2][2] = origin[2] + 2.0;

    
traceEnds[3][0] = origin[0] + 2.0;
    
traceEnds[3][1] = origin[1] - 2.0;
    
traceEnds[3][2] = origin[2] - 2.0;

    
traceEnds[4][0] = origin[0] - 2.0;
    
traceEnds[4][1] = origin[1] + 2.0;
    
traceEnds[4][2] = origin[2] - 2.0;

    
traceEnds[5][0] = origin[0] - 2.0;
    
traceEnds[5][1] = origin[1] + 2.0;
    
traceEnds[5][2] = origin[2] + 2.0;

    
traceEnds[6][0] = origin[0] + 2.0;
    
traceEnds[6][1] = origin[1] + 2.0;
    
traceEnds[6][2] = origin[2] + 2.0;

    
traceEnds[7][0] = origin[0] + 2.0;
    
traceEnds[7][1] = origin[1] + 2.0;
    
traceEnds[7][2] = origin[2] - 2.0;

    for ( new 
08i++ )
    {
        if ( 
PointContentstraceEnds[i] ) != CONTENTS_EMPTY )
            return 
1;

        
hitEnt trace_line0origintraceEnds[i], traceHit );
        if ( 
hitEnt != -)
            return 
1;
        for ( new 
03j++ )
        {
            if ( 
traceEnds[i][j] != traceHit[j] )
                return 
1;
        }
    }

    return 
0;
}

public 
make_paintid )
{
    new 
wpn read_data);
    new 
ammo read_data);
    if( 
paintball && lastwpn[id] == wpn && lastammo[id] > ammo )
    {
        new 
iOrigin[3];
        
get_user_originidiOrigin);
        new 
Float:fOrigin[3];
        
IVecFVeciOriginfOrigin );

        if( 
entity_count( ) < ( get_global_intGL_maxEntities ) - 100 ) && worldInVicinityfOrigin ) )
        {
            new 
ent create_entity"info_target" );
            if( 
ent )
            {
                
entity_set_stringentEV_SZ_classname"paint_ent" );
                
entity_set_intentEV_INT_movetype);
                
entity_set_intentEV_INT_solid);
                
entity_set_modelentg_paintSprite[random_num0)] );
                new 
rgb;
                if( ! 
pb_rndcolor )
                {
                    new 
random_num0MAX_COLORS );
                    
g_paintColors[i][0];
                    
g_paintColors[i][1];
                    
g_paintColors[i][2];
                }
                else
                {
                    
random_num64255 );
                    
random_num64255 );
                    
random_num64255 );
                }
                
set_renderingentkRenderFxNoDissipationrgbkRenderGlow255 );
                
entity_set_originentfOrigin );
            }
        }
    }
    
lastwpn[id] = wpn;
    
lastammo[id] = ammo;
}

public 
new_round( )
{
    
remove_entity_name"paint_ent" );
    
/* Check the cvars on newround */
    
if ( get_pcvar_numpcvar_pb ) )
        
paintball true;
    else
        
paintball false;
    if ( 
get_pcvar_numpcvar_pb_rndcol ) )
        
pb_rndcolor true;
    else
        
pb_rndcolor false;

__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
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 17:51.


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