It's Mods

Full Version: Koils Random Scripts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
NO WALL BANG TAGS + CUSTOM HIT SOUND THRU WALLS

Code:
                if ( iDamage > 1 )
                    {
                    if ( iDamage > 99 )
                    {
                    eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( hasBodyArmor, sMeansOfDeath );
                    }
                    else
                    {
                    start = eAttacker getTagOrigin("tag_eye");
                    end = self.origin + (0, 0, maps\mp\gametypes\_globallogic_utils::getHitLocHeight( sHitLoc ));
                        if(bulletTracePassed(start, end, false, eAttacker))
                         {
                         eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( hasBodyArmor, sMeansOfDeath );
                         }
                         if(bulletTracePassed(start, end, false, eAttacker) == false)
                         {
                        eAttacker playLocalSound( "prj_bullet_impact_ap_flesh" );
                         }
                        if ( !isAlive( self ) )
                        {
                        eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( hasBodyArmor, sMeansOfDeath );
                        }
                    }

Add to global logic player





Proper AWP Fix

Code:
doAwpFix()
{
    while(1)
    {
        self waittill ( "weapon_fired" );
        cww = self GetCurrentWeapon();
        if ( cww == "l96a1_mp" || cww == "mosin_sp" )
        {
            self allowADS(false);
            wait 0.8;
            self allowADS(true);
        }
    }
}

self thread on player spawned



LIST ALIVE PLAYERS NAMES

Code:
listthem2()
{
    wait 0.1;
    alist = self createFontString( "default", 1 );
    alist setPoint( "TOP", "CENTER", 0, 105 );
    dlist = self createFontString( "default", 1 );
    dlist setPoint( "TOP", "CENTER", 0, 135 );
    level.aliveDefendString = "";
    level.aliveattackString = "";
    alist setText("");
    dlist setText("");
    while(1) {
    wait 1;  
    for(i=0;i<level.players.size;i++)
    {
        player = level.players[i];
        
        //do attack
        if (IsAlive(player) && player.pers["team"] == game["attackers"]) {
                level.aliveDefendString += player.name;
                alist setText( level.aliveAttackString );
                }
        else if (!IsAlive(player) && player.pers["team"] == game["attackers"]) {
                level.aliveDefendString += player.name;    
                alist setText( level.aliveAttackString );
                }
                
        //do defense
        else if (IsAlive(player) && player.pers["team"] == game["defenders"]) {
                level.aliveDefendString += player.name;
                dlist setText( level.aliveDefendString );
                }
        else if (!IsAlive(player) && player.pers["team"] == game["defenders"]) {
                level.aliveDefendString += player.name;
                dlist setText( level.aliveDefendString );
                }                    
          }
              level.aliveDefendString = "";
    level.aliveattackString = "";
    alist setText("");
    dlist setText("");
    }
}

ADD TO ON PLAYER SPAWNED



LIMIT WEAPONS

Code:
scopecheck()
{

classUsers = 0;
for( i = 0; i < level.players.size; i++ )
{
if( self.pers["team"] == "spectator" )
continue;

if( level.players[i].pers["team"] == "spectator" )
continue;

if( self.pers["team"] != level.players[i].pers["team"] )
continue;

if( self == level.players[i] )
continue;

if( level.players[i].pers["mod_primary"] != "mosin_sp" && level.players[i].pers["mod_primary"] != "l96a1_mp" )
continue;

classUsers++;
}

if ( level.gameType != "sd" )
return true;

if( classUsers < level.weaponLimit["weapon_sniper"] )
return true;

return false;
}

THREAD TO CHECK ON MENU SELECT OF ITEM / ITEM HAND OUTS



GIVE CERTAIN GUNS A CERTAIN CLIP SIZE

Code:
goldammo()
{
    self switchtoweapon( self.pers["mod_primary"] );
    self setWeaponAmmoStock( self.pers["mod_primary"] , WeaponClipSize( self.pers["mod_primary"] ) * 4 );
}

SELF THREAD ON SPAWN - CHANGE THE SELF.PERS TO THE WEAPON NAME YOU WANT EXAMPLE "AK47_MP"



LIMIT ONE FLASH/SMOKE/NADE/KNIFE W/E

Code:
dooneflash() {
    self endon ( "disconnect" );
    self endon ( "menuover" );

countflash = undefined;
while(1) {
    wait 2;
    countflash = self getWeaponAmmoStock("flash_grenade_mp");
if ( countflash == 2 ) {
    self setWeaponAmmoClip("flash_grenade_mp", 1);
  }
}
}

SELF THREAD ON SPAWN




BLOCK OFF INVISIBLE RAILINGS

Code:
domaps()
{

    if(getDvar("mapname") == "mp_hanoi") { /** Hanoi **/
    
    object = spawn("script_model", (521, -1911, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -42.777, 0);
    
    object = spawn("script_model", (488, -1947.7, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -42.777, 0);
    
    object = spawn("script_model", (454.199, -1982.62, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -42.777, 0);
    
    object = spawn("script_model", (420.198, -2015, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -42.777, 0);
    
    object = spawn("script_model", (386.199, -2045, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -42.777, 0);
    

    
    
    
    
    object = spawn("script_model", (320, -2035, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -135.555, 0);

    object = spawn("script_model", (343, -2052, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -135.555, 0);
    
    
    
    
    }
    if(getDvar("mapname") == "mp_duga") { /** Grid **/
    
    object = spawn("script_model", (-1514.43, -4188.36, 134.607) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);

    object = spawn("script_model", (-1365, -4188.36, 36) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);


    object = spawn("script_model", (-1395, -4188.36, 50) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);
    
    object = spawn("script_model", (-1425, -4188.36, 64) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);
    
    object = spawn("script_model", (-1435, -4188.36, 78) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);
    
    object = spawn("script_model", (-1455, -4188.36, 92) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);
    
    object = spawn("script_model", (-1475, -4188.36, 106) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);
    
    object = spawn("script_model", (-1495.43, -4188.36, 120) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -92.6202, 0);
    }

        if(getDvar("mapname") == "mp_crisis") { /** Crisis **/

        object = spawn("script_model", (-1710, 1595 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
        object = spawn("script_model", (-1710, 1545 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
        object = spawn("script_model", (-1710, 1495 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
        object = spawn("script_model", (-1710, 1445 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
        object = spawn("script_model", (-1710, 1395 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
        object = spawn("script_model", (-1710, 1345 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
        object = spawn("script_model", (-1710, 1295 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
    object = spawn("script_model", (-1710, 1245 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
    object = spawn("script_model", (-1710, 1195 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
    object = spawn("script_model", (-1710, 1145 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);
    
    object = spawn("script_model", (-1710, 1646 ,198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -179, 0);


    object = spawn("script_model", (-1761, 1176, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");    
    object.angles = (0, -179, 0);
    
    object = spawn("script_model", (-1761, 1187, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");    
    object.angles = (0, -179, 0);
    object = spawn("script_model", (-1761, 1236, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");    
    object.angles = (0, -179, 0);
    object = spawn("script_model", (-1761, 1279, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");    
    object.angles = (0, -179, 0);
    
        object = spawn("script_model", (-1761, 1305, 64.125) );
    object setModel("p_glo_sandbags_lego_mdl_mp");    
    object.angles = (0, -179, 0);
    
    
    object = spawn("script_model", (-1675, 1678, 198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -88, 0);
    object = spawn("script_model", (-1628, 1678, 198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -88, 0);
    
    object = spawn("script_model", (-1675, 1104, 198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -88, 0);
    object = spawn("script_model", (-1628, 1104, 198) );
    object setModel("p_glo_sandbags_lego_mdl_mp");
    object.angles = (0, -88, 0);
    
    }    
}

DO ON LEVEL THREAD




RESPAWN A PLAYER

Code:
Respawn()
{
   self thread maps\mp\gametypes\_globallogic_spawn::spawnPlayer();
}

SELF THREAD ON DEATH




PROPER SILENT FOOTSTEPS

Code:
doSilentFootSteps()
{
    while( 1 )
    {
        wait 0.05;
        if ( self GetStance() == "prone" ||  self GetStance() == "crouch" && self isonground() || self playerADS() && self isonground() )
        {
            wait 0.15;
            self setPerk("specialty_quieter");
        }
        else
        {
            self unsetPerk("specialty_quieter");
            wait 0.15;
        }
    }
}

SELF THREAD ON SPAWN



FASTER WEAPON RELOAD ON SPECIFIC GUN

Code:
dopython()
{
    self endon( "death" );
    self endon( "disconnect" );
    for(;;)
    {
        currentweapon = self GetCurrentWeapon();
        if ( currentweapon == "python_mp" && !self hasPerk( "specialty_fastreload" ) )
        {
            self setPerk("specialty_fastreload");
        }
        if (currentweapon != "python_mp" && self hasPerk( "specialty_fastreload" ) )  
        {
          self unsetPerk( "specialty_fastreload" );
        }
        else
        {
        wait 0.15;
        }
    }
}

SELF THREAD ON SPAWN




CHANGE INGAME CHAT POSITIONS

Code:
normalchat() {
    self setclientdvar( "cg_hudChatPosition", "5 200");
    self setclientdvar( "cg_hudSayPosition", "5 180");
    self setclientdvar( "cg_chatHeight", "4");
    self setclientdvar( "cg_chatTime", "12000");
}

SELF THREAD WHEN EVER






WILL ADD MORE LATER, JUST SOME THINGS PPL MIGHT USE OR CAN LEARN OFF.
(09-07-2011 03:04)koil Wrote: [ -> ].....

and ofc while i'm writing this you change the post ._.

good code for those who will need it...

I HAZ TO FIX PART OF IT:

Code:
                if ( iDamage > 1 )
                    {
                        if ( iDamage > 99 )
                            eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( hasBodyArmor, sMeansOfDeath );
                        else
                        {
                            start = eAttacker getTagOrigin("tag_eye");
                            end = self.origin + (0, 0, maps\mp\gametypes\_globallogic_utils::getHitLocHeight( sHitLoc ));
                            result = bulletTracePassed(start, end, false, eAttacker);
                            
                            if(result)
                                eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( hasBodyArmor, sMeansOfDeath );
                            if(!result)
                                eAttacker playLocalSound( "prj_bullet_impact_ap_flesh" );
                            if ( !isAlive( self ) )
                            eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( hasBodyArmor, sMeansOfDeath );
                        }
                    }

Nyan Cat
eh, both work.. w/e.
cool some of that looks like its from cmmod , and other mods from even cod4 days but other wise nice , keep up the mutuality Smile
(09-07-2011 04:26)sirmodsalot Wrote: [ -> ]cool some of that looks like its from cmmod , and other mods from even cod4 days but other wise nice , keep up the mutuality Smile

The only thing I used as a reference was xkmod for the awpfix, apart from that everything was written by me with out looking at cod4/cmmod that i posted there & getting help off itsmods.
Simplefied awp fix

Code:
doAwpFix()
{
    while(1)
    {
        self waittill ( "weapon_fired", weapon );
        if ( weapon == "l96a1_mp" || weapon == "mosin_sp" )
        {
            self allowADS(false);
            wait 0.8;
            self allowADS(true);
        }
    }
}

also the Weaponlimit code is definitly a modified version of the mw2 promod weaponlimit code

http://pastebin.com/5tG9hUm6
the only thing the same is the classusers variable, lol... the mw2 code was no where near functioning on BO, was a good reference though which is why i said i learnt most of this from itsmods.
Reference URL's