Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 66 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Random Weapons and Names for AI
Versions: You must be logged in to view history.

This will show you how to give AI a random weapon and name

 

// This is how to add a an AI Random Weapon Script
thread random_weapon( ai, weapon1, weapon2, weapon3, weapon4, weapon5 );
random_weapon( ai, weapon1, weapon2, weapon3, weapon4, weapon5 )
{
weapon = randomint (5);
if (weapon = 1)
{
                 thread ai_addweapon( ai, weapon1 );
}
else if (weapon = 2)
{
                 thread ai_addweapon( ai, weapon2 );
}
else if (weapon = 3)
{
                 thread ai_addweapon( ai, weapon3 );
}
else if (weapon = 4)
{
                 thread ai_addweapon( ai, weapon4 );
}
else if (weapon = 5)
{
                 thread ai_addweapon( ai, weapon5 );
}
}
ai_addweapon( ai, weapon1 )
{
ai animscriptsinit::initWeapon( weapon1, "primary" );
ai animscriptsshared::placeWeaponOn( weapon1, "right" );
ai.primaryweapon = ai.weapon;
ai.lastweapon = ai.weapon;
}
ai_addweapon( ai, weapon2 )
{
ai animscriptsinit::initWeapon( weapon2, "primary" );
ai animscriptsshared::placeWeaponOn( weapon2, "right" );
ai.primaryweapon = ai.weapon;
ai.lastweapon = ai.weapon;
}
ai_addweapon( ai, weapon3 )
{
ai animscriptsinit::initWeapon( weapon3, "primary" );
ai animscriptsshared::placeWeaponOn( weapon3, "right" );
ai.primaryweapon = ai.weapon;
ai.lastweapon = ai.weapon;
}
ai_addweapon( ai, weapon4 )
{
ai animscriptsinit::initWeapon( weapon4, "primary" );
ai animscriptsshared::placeWeaponOn( weapon4, "right" );
ai.primaryweapon = ai.weapon;
ai.lastweapon = ai.weapon;
}
ai_addweapon( ai, weapon5 )
{
ai animscriptsinit::initWeapon( weapon5, "primary" );
ai animscriptsshared::placeWeaponOn( weapon5, "right" );
ai.primaryweapon = ai.weapon;
ai.lastweapon = ai.weapon;
}
// E.G. thread random_weapon( level.price, "m4_grunt", "m4_silencer", "m4_grenadier", "ak74u", "ak47" );
// Also here is a script for random names without the Pvt. or Cpl. or Sgt.
random_weapon( ai )
{
name = randomint (5);
if (name = 1)
{
                 ai.name = "name1";
}
else if (name = 2)
{
                 ai.name = "name2";
}
else if (name = 3)
{
                 ai.name = "name3";
}
else if (name = 4)
{
                 ai.name = "name4";
}
else if (name = 5)
{
                 ai.name = "name5";
}
}

 

// This is how to add a an AI Random Weapon Script

 

thread random_weapon( ai, weapon1, weapon2, weapon3, weapon4, weapon5 );

 

random_weapon( ai, weapon1, weapon2, weapon3, weapon4, weapon5 )

{

weapon = randomint (5);

if (weapon = 1)

{

                 thread ai_addweapon( ai, weapon1 );

}

else if (weapon = 2)

{

                 thread ai_addweapon( ai, weapon2 );

}

else if (weapon = 3)

{

                 thread ai_addweapon( ai, weapon3 );

}

else if (weapon = 4)

{

                 thread ai_addweapon( ai, weapon4 );

}

else if (weapon = 5)

{

                 thread ai_addweapon( ai, weapon5 );

}

}

 

ai_addweapon( ai, weapon1 )

{

ai animscriptsinit::initWeapon( weapon1, "primary" );

ai animscriptsshared::placeWeaponOn( weapon1, "right" );

ai.primaryweapon = ai.weapon;

ai.lastweapon = ai.weapon;

}

 

ai_addweapon( ai, weapon2 )

{

ai animscriptsinit::initWeapon( weapon2, "primary" );

ai animscriptsshared::placeWeaponOn( weapon2, "right" );

ai.primaryweapon = ai.weapon;

ai.lastweapon = ai.weapon;

}

 

ai_addweapon( ai, weapon3 )

{

ai animscriptsinit::initWeapon( weapon3, "primary" );

ai animscriptsshared::placeWeaponOn( weapon3, "right" );

ai.primaryweapon = ai.weapon;

ai.lastweapon = ai.weapon;

}

 

ai_addweapon( ai, weapon4 )

{

ai animscriptsinit::initWeapon( weapon4, "primary" );

ai animscriptsshared::placeWeaponOn( weapon4, "right" );

ai.primaryweapon = ai.weapon;

ai.lastweapon = ai.weapon;

}

 

ai_addweapon( ai, weapon5 )

{

ai animscriptsinit::initWeapon( weapon5, "primary" );

ai animscriptsshared::placeWeaponOn( weapon5, "right" );

ai.primaryweapon = ai.weapon;

ai.lastweapon = ai.weapon;

}

 

// E.G. thread random_weapon( level.price, "m4_grunt", "m4_silencer", "m4_grenadier", "ak74u", "ak47" );

 

// Also here is a script for random names without the Pvt. or Cpl. or Sgt.

 

thread random_name( ai );

 

random_name( ai )

{

name = randomint (5);

if (name = 1)

{

                 ai.name = "name1";

}

else if (name = 2)

{

                 ai.name = "name2";

}

else if (name = 3)

{

                 ai.name = "name3";

}

else if (name = 4)

{

                 ai.name = "name4";

}

else if (name = 5)

{

                 ai.name = "name5";

}

}

// E.G. thread random_name( level.price );

Only random name is confirmed message me if there is any errors

 

 

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»