View Single Post
Plugin Info:     Modification:          Category:          Approver:   Exolent[jNr] (178)
khios
Junior Member
Join Date: Mar 2009
Location: Belgium
Old 03-17-2009 , 12:52   DeFRAG [1.0 OUT] // News to come soon!
Reply With Quote #1

DeFRAG 1.0 BETA

by superNOVA_


Description: DeFRAG is a plugin that modify the game experience of the user. Super speed, total control and trick maps are the mains points. If you want a totally new experience try this!

No more need of svdefrag.cfg! Server config added in the plugin! =)
Have fun with it! And I'm looking for one or two mappers

How to :
Download defrag.sma
cldefrag
defrag_trainv2b

For executing! Place defrag.amxx in plugin folder and add it to the plugins.ini file [found in the amxmodx/configs folder]
place cldefrag in your cstrike folder
Launch game and exec cldefrag.cfg
Play the game

New map out to! defrag_trainv2b -> Harder friends harder....

Here's some pics of each part of the map! First line is knife speed part, second is scout part!!

And a video too

http://www.dailymotion.com/video/x8q...s16_videogames : streaming with sound
http://www.youtube.com/watch?v=Wj6is36wRaE : streaming (without sound)
http://www.filedropper.com/defrag_2 : direct download





Continue giving me advice it motives me to do great work for the community

Cya and have fun with the plugin

Quote:
Changelog
0.1 - Pasted different codes without any kind of experience
0.5 - Added scout_conc
0.6 - Modified scout cvar to be a bit harder
0.9 - Redone part of the code need some explanation from pro to do better
0.91 - Removed double register_forward!
1.0 - Recoded many many things

Plugin Change to come
- Add Noclip and Grenade conc

MAP Change to come :
-Help printed on wall to fully understand the process
PHP Code:
/*

    DeFRAG for CS1.6
    Version 1.0
    By superNOVA_
    
    Information about this plugin can be found at:
    https://forums.alliedmods.net/showthread.php?t=87863

*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN    "DeFRAG"
#define AUTHOR    "superNOVA_"
#define VERSION    "1.0"


new bool:g_bAlive[33]
new 
lastammo[33
new 
lastweap[33]
new 
defrag_scoutpush
new defrag_scoutradius
new g_defrag_nodamages
new g_pcvarGravity
new g_iCdWaterJumpTime[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// SERVER CVARS
    
set_cvar_num ("sv_gravity"600// Set the server gravity [600 for DeFRAG is really good]
    
set_cvar_num ("sv_maxspeed"1500// Set player maxspeed
    
set_cvar_num ("mp_startmoney"0// Set player start money [Don't make buy zone in DeFRAG just place armory_entity]
    
set_cvar_num ("mp_timelimit"0// Time before map changes
    
set_cvar_num ("sv_airaccelerate"100)
    
set_cvar_num ("mp_freezetime"0)
    
set_cvar_num ("mp_autoteambalance"0)
    
set_cvar_num ("mp_limitteams"0)
    
register_clcmd "+sprint""defrag_start_sprint")
    
register_clcmd "-sprint""defrag_stop_sprint")
    
register_event("CurWeapon","make_tracer""be""1=1");    
    
RegisterHam(Ham_TakeDamage"player""defrag_nodamages")
    
RegisterHam(Ham_Player_Jump"player""Player_Jump")
    
register_forward(FM_UpdateClientData"UpdateClientData")
    
register_forward(FM_CmdStart"CmdStart")
    
RegisterHam(Ham_Spawn"player""Check_Alive"1)
    
RegisterHam(Ham_Killed"player""Check_Alive"1)
    
g_pcvarGravity get_cvar_pointer("sv_gravity")
    
    
// DeFRAG Sprint CVARS
    #define KNIFE_SPRINT_SPEED 1500.0          // Define the speed when using +sprint cmd
    #define KNIFE_DEFAULT_SPEED 500.0        // Define normal move speed with the knife (Default Cs1.6 = 250)
    
    // DeFRAG Scout CVARS
    
defrag_scoutpush register_cvar("scout_conc","1000.0"); // Force of the push
    
defrag_scoutradius register_cvar("scout_radius","1000.0"); // Area covered by the push
    #define CONC_WEAP CSW_SCOUT        // Define wich weapon to use for having a conc push
    
    // DeFRAG No Damages
    
g_defrag_nodamages register_cvar ("mp_falldamage""0.0"// Set the amount of damages taken from falling (1 = normal damages)
    
    // DeFRAG BHOP
    #define PLAYER_JUMP     6
    
}

public 
Check_Alive(id

        
g_bAlive[id] = bool:is_user_alive(id



        
// DeFRAG Knife
        
new const g_szKnifeModel[] = "models/v_knife.mdl";  // To set the knife model! Easy if you want to use custom models (will make some soon just for DeFRAG)
const KNIFE_DRAW_ANIMATION 3

    public 
defrag_start_sprint ( const PlayerId )
    {
        if ( 
get_user_weapon PlayerId ) == CSW_KNIFE )
        {
            
UTIL_SetPlayerSpeed PlayerIdKNIFE_SPRINT_SPEED );
            
set_pev PlayerIdpev_viewmodel2"" );
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    public 
defrag_stop_sprint ( const PlayerId )
    {
        if( 
get_user_weaponPlayerId ) == CSW_KNIFE )
        {
            
UTIL_SetPlayerSpeed PlayerIdKNIFE_DEFAULT_SPEED );

            
set_pevPlayerIdpev_viewmodel2g_szKnifeModel );
            
set_pevPlayerIdpev_weaponanimKNIFE_DRAW_ANIMATION );
            
            
message_beginMSG_ONE_UNRELIABLESVC_WEAPONANIM_PlayerId );
            
write_byteKNIFE_DRAW_ANIMATION );
            
write_bytepevPlayerIdpev_body ) );
            
message_end();
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    
UTIL_SetPlayerSpeed ( const PlayerId, const Float:Speed )
    { 
        
set_pevPlayerIdpev_maxspeedSpeed ); 
        
engfuncEngFunc_SetClientMaxspeedPlayerIdSpeed ); 
    }
    
    
    
// DeFRAG Scout
    
stock get_velocity_from_originentFloat:fOrigin[3], Float:fSpeedFloat:fVelocity[3] )
{
    new 
Float:fEntOrigin[3];
    
peventpev_originfEntOrigin );

    
// Velocity = Distance / Time

    
new Float:fDistance[3];
    
fDistance[0] = fEntOrigin[0] - fOrigin[0];
    
fDistance[1] = fEntOrigin[1] - fOrigin[1];
    
fDistance[2] = fEntOrigin[2] - fOrigin[2];

    new 
Float:fTime = ( vector_distancefEntOrigin,fOrigin ) / fSpeed );

    
fVelocity[0] = fDistance[0] / fTime;
    
fVelocity[1] = fDistance[1] / fTime;
    
fVelocity[2] = fDistance[2] / fTime;

    return ( 
fVelocity[0] && fVelocity[1] && fVelocity[2] );
}


// Sets velocity of an entity (ent) away from origin with speed (speed)

stock set_velocity_from_originentFloat:fOrigin[3], Float:fSpeed )
{
    new 
Float:fVelocity[3];
    
get_velocity_from_originentfOriginfSpeedfVelocity )

    
set_peventpev_velocityfVelocity );

    return ( 
);
}

public 
make_tracer(id)
{
    new 
Float:maxboost get_pcvar_floatdefrag_scoutpush );
    if( !
maxboost )
        return;

    new 
weap read_data(2);        // id of the weapon
    
new ammo read_data(3);        // ammo left in clip

    
if( weap == CONC_WEAP && g_bAlive[id] ){

        if( 
lastweap[id] == )
            
lastweap[id] = weap;

        if( 
lastammo[id] > ammo && lastweap[id] == weap ){
            new 
Vec[3], Float:fVec[3], Float:origin[3];
            
get_user_origin(idVec3);

            
IVecFVec(VecfVec);

            
pev(idpev_originorigin);
            new 
Float:dist get_distance_foriginfVec );
            new 
Float:radius get_pcvar_floatdefrag_scoutradius );
            if(
dist <= radius){
                new 
Float:boost maxboost - ( ( maxboost dist) / radius );
                
set_velocity_from_origin(idfVecboost);
            }
        }
        
lastammo[id] = ammo;
        
lastweap[id] = weap;
    }
}


    
// DeFRAG nodamages

public defrag_nodamages(identidattackerFloat:damagedamagebits)
{
    if( 
damagebits != DMG_FALL )
        return 
HAM_IGNORED

    damage 
*= get_pcvar_float(g_defrag_nodamages)
    
SetHamParamFloat(4damage)

    return 
HAM_HANDLED
}



    
// DeFRAG BHOP
    
public CmdStart(iduc_handleseed)
{
    if( 
g_bAlive[id] && get_uc(uc_handleUC_Buttons) & IN_USE && pev(idpev_flags) & FL_ONGROUND )
    {
        static 
Float:fVelocity[3]
        
pev(idpev_velocityfVelocity)
        
fVelocity[0] *= 0.3
        fVelocity
[1] *= 0.3
        fVelocity
[2] *= 0.3
        set_pev
(idpev_velocityfVelocity)
    }
}

public 
Player_Jump(id)
{
    if(    !
g_bAlive[id]
    ||    
g_iCdWaterJumpTime[id]
    ||    
pev(idpev_waterlevel) >= 2    )
    {
        return
    }

    static 
iFlags iFlags pev(idpev_flags)
    if( !(
iFlags FL_ONGROUND) )
    {
        return
    }

    static 
iOldButtons iOldButtons pev(idpev_oldbuttons)
    if( 
iOldButtons IN_JUMP )
    {
        return
    }

    
set_pev(idpev_oldbuttonsiOldButtons IN_JUMP)

    static 
Float:fVelocity[3]
    
pev(idpev_velocityfVelocity)

    static 
Float:fFrameTimeFloat:fPlayerGravity
    global_get
(glb_frametimefFrameTime)
    
pev(idpev_gravityfPlayerGravity)

    
fVelocity[2] = 268.328157 fPlayerGravity fFrameTime 0.5 get_pcvar_num(g_pcvarGravity)

    
set_pev(idpev_velocityfVelocity)
    
set_pev(idpev_gaitsequencePLAYER_JUMP)
    
set_pev(idpev_frame0.0)
}

public 
UpdateClientData(idsendweaponscd_handle)
{
    
g_iCdWaterJumpTime[id] = get_cd(cd_handleCD_WaterJumpTime)

Credit goes to

ConnorMcLeod : Bhop script -> http://forums.alliedmods.net/showthr...light=slowdown
skyjur : Semiclip -> http://forums.alliedmods.net/showthr...light=semiclip post #6
arkshine : Sprint plugin code [VERSION 2] -> http://forums.alliedmods.net/showthread.php?t=85767 post #10
Meow meow : Scout conc -> http://forums.alliedmods.net/showthr...highlight=conc [Original idea from Fatalis]
Attached Files
File Type: zip defrag_train.zip (370.0 KB, 867 views)
File Type: cfg cldefrag.cfg (79 Bytes, 988 views)
File Type: zip defrag_trainv2b.zip (641.9 KB, 1045 views)
File Type: sma Get Plugin or Get Source (defrag.sma - 2438 views - 6.8 KB)

Last edited by khios; 03-26-2009 at 14:28. Reason: DeFRAG is now at 1.0 =)
khios is offline
Send a message via MSN to khios Send a message via Skype™ to khios