Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Koils Random Scripts
#1
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.
Reply

#2
(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
[Image: b_560_95_1.png]
Reply

#3
eh, both work.. w/e.
Reply

#4
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
Reply

#5
(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.
Reply

#6
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
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#7
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.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] [SOURCE] Random Weapons. [HARD] Tony. 1 4,135 11-08-2013, 11:11
Last Post: Nekochan
  Help source random weapons [HARD] Tony. 4 4,734 11-08-2013, 05:25
Last Post: [HARD] Tony.
  Help choose 2 random players?(1 each team) 26hz 6 4,688 09-12-2013, 17:32
Last Post: Yamato
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,482 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,777 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Receiving a random primary & secondary DidUknowiPwn 5 4,437 07-22-2013, 09:47
Last Post: Yamato
  What script controls the "random" aspect to care packages? akillj 2 3,282 06-05-2013, 11:24
Last Post: akillj
  Random anims master131 14 10,916 05-24-2013, 09:45
Last Post: [HARD] Tony.
  [Request] Random player model hillbilly 1 2,767 05-12-2013, 08:30
Last Post: archit
  [Release] Random Functions 1.1 Yamato 22 13,487 04-20-2013, 10:13
Last Post: Dominator56

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.