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

[Stock] Grenade Way


Post New Thread Reply   
 
Thread Tools Display Modes
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 02-06-2012 , 05:58   Re: [Stock] Grenade Way
Reply With Quote #11

Failed to compile

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

new laser;

public 
plugin_precache(){
        
laser   =       precache_model("sprites/laserbeam.spr")
}

public 
client_PreThinkid ){
        if( 
is_user_aliveid ) ){
                new 
iWeapon     =       get_user_weaponid );
                
                if( 
iWeapon == CSW_HEGRENADE || iWeapon == CSW_SMOKEGRENADE || iWeapon == CSW_FLASHBANG ){
                        
showGrenadeWayid iWeapon );
                }
        }
}  

stock showGrenadeWay id weapon ){
    new 
Float:fGrenadeGrav 1.0;

    switch( 
weapon) {
    case 
CSW_HEGRENADE:
        
fGrenadeGrav    =                 0.55;
    case 
CSW_FLASHBANG:
        
fGrenadeGrav    =                 0.5;
    case 
CSW_SMOKEGRENADE:
        
fGrenadeGrav    =                 0.5;
    }
    static 
pGrav;
    
    if( !
pGrav )    pGrav   =          get_cvar_pointer"sv_gravity" );
    
    new 
Float:fStartPos] , FloatfViewOfs] , FloatfVector] , FloatfVeloc ] , FloatfAngles ] , FloatfEndPos ] , FloatfTmpVector ] , pTr FloatfFraction FloatfNormal ] , iCollision FloatfVel;
    new 
Float:fGrav =                 get_pcvar_floatpGrav ) , pHit 0;

    const            
maxCollsion                =            30;
    const 
Float:    fConstAliveTime            =            2.0;
    const 
Float:    fConstLoops                =            20.0;
    new 
Float:        fAliveTime                =            0.0;
    new 
Float:        fStep                    =            fConstAliveTime fConstLoops;

    
pevid pev_origin fStartPos );
    
pevid pev_view_ofs fViewOfs );
    
pevid pev_velocity fVeloc );
    
pevid pev_v_angle fAngles );

    
xs_vec_addfStartPos fViewOfs fStartPos );

    if (
fAngles[0] < 0)
        
fAngles[0] = -10.0 fAngles[0] * ((90.0 10.0) / 90.0);
    else
        
fAngles[0] = -10.0 fAngles[0] * ((90.0 10.0) / 90.0);

    
fVel = (90.0 fAngles[0]) * 6.0;
    if (
fVel 750.0)
        
fVel 750.0;

    
pevid pev_v_angle fAngles );

    
angle_vectorfAngles ANGLEVECTOR_FORWARD fVector );

    
xs_vec_mul_scalarfVector 16.0 fTmpVector );

    
xs_vec_addfStartPos fTmpVector fStartPos );

    
xs_vec_mul_scalarfVector fVel fVector );

    
xs_vec_addfVector fVeloc fVector );


    for( ; 
fAliveTime fConstAliveTime fAliveTime += fStep ){

        
xs_vec_copyfStartPos fEndPos);
        
xs_vec_mul_scalarfVector fStep fTmpVector );
        
xs_vec_addfEndPos fTmpVector fEndPos );

        
pTr       =              create_tr2();

        
engfunc(EngFunc_TraceLinefStartPosfEndPosDONT_IGNORE_MONSTERSidpTr )
        
        if( 
fAliveTime == 0.0 ){
            
fStartPos ] += 10.0;
        }

        
get_tr2pTr TR_flFraction fFraction);

        
pHit    =                 get_tr2pTr TR_pHit );

        if( 
pHit != id && fFraction 1.0 ){
            
get_tr2pTr TR_vecEndPos fEndPos );
            
            
get_tr2pTr TR_vecPlaneNormal fNormal )
            
            if( 
fNormal ] > 0.9 && fVector ] <= 0.0 && fVector ] >= -fGrav 0.20 ){
                return ;
            }

            new 
FloatfScalar xs_vec_dotfVectorfNormal ) * 1.3;

            
fVector[0] = fVector[0] - fScalar fNormal[0];
            
fVector[1] = fVector[1] - fScalar fNormal[1];
            
fVector[2] = fVector[2] - fScalar fNormal[2];

            
iCollision++;

            if(  
iCollision maxCollsion )
            break;

            
fAliveTime              -=        fStep   *             ( 1.0 fFraction ) ;
        }
        
        new 
iR iG iB;

        switch( 
weapon ) {
        case 
CSW_HEGRENADE:{
                
iR 250;
                
iG 0;
                
iB 0;
            }
        case 
CSW_FLASHBANG:{
                
iR 0;
                
iG 0;
                
iB 250;
            }
        case 
CSW_SMOKEGRENADE:{
                
iR 0;
                
iG 250;
                
iB 0;
            }
        }
        
        
message_beginMSG_ONE_UNRELIABLE SVC_TEMPENTITY , { } , id )
        
write_byte(0)                     // TE_BEAMPOINTS
        
engfuncEngFunc_WriteCoord fStartPos ] )
        
engfuncEngFunc_WriteCoord fStartPos ] )
        
engfuncEngFunc_WriteCoord fStartPos ] )
        
engfuncEngFunc_WriteCoord fEndPos ] )
        
engfuncEngFunc_WriteCoord fEndPos ] )
        
engfuncEngFunc_WriteCoord fEndPos ] )
        
write_short(laser)
        
write_byte(1)
        
write_byte(1)
        
write_byte(1)
        
write_byte(15)
        
write_byte(0)
        
write_byteiR )
        
write_byteiG )
        
write_byteiB )
        
write_byte(210)
        
write_byte(0)
        
message_end()

        
xs_vec_copyfEndPos fStartPos );
        
        
fVector]    -=              floatmulfloatmulfGrenadeGrav fGrav ) , floatmulfFraction fStep ) );

        
free_tr2pTr );
    }

RuRuRu612754 is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 02-06-2012 , 07:17   Re: [Stock] Grenade Way
Reply With Quote #12

Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Header size: 580 bytes
Code size: 7052 bytes
Data size: 152 bytes
Stack/heap size: 16384 bytes; estimated max. usage=523 cells (2092 bytes)
Total requirements: 24168 bytes
Done.

Compilation Time: 1,60 sec
__________________
kiki33hun is offline
RuRuRu612754
Senior Member
Join Date: Sep 2011
Old 02-06-2012 , 08:24   Re: [Stock] Grenade Way
Reply With Quote #13

Sorry.
#include <amxmodx> →include <amxmodx>
RuRuRu612754 is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 02-06-2012 , 09:44   Re: [Stock] Grenade Way
Reply With Quote #14

Quote:
Originally Posted by RuRuRu612754 View Post
Sorry.
#include <amxmodx> →include <amxmodx>
__________________
kiki33hun 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 04:29.


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