![]() |
|
Same random weapon to all? - Printable Version +- ItsMods (https://www.itsmods.com) +-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html) +--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html) +--- Thread: Same random weapon to all? (/Thread-Same-random-weapon-to-all.html) Pages:
1
2
|
Same random weapon to all? - GoldenWrapper - 08-24-2011 Hi all, I'm working on a new mod which is similar to BO's "Sharpshooter" I tried the code from my old mod: Code: giveRandomWeapon()
{
weaponList = [];
weaponList[weaponList.size] = "SPAS_mp";
weaponList[weaponList.size] = "rottweil72_mp";
weaponList[weaponList.size] = "Ithaca_mp";
weaponList[weaponList.size] = "hs10_mp";
wait 1.00;
self takeallweapons();
weapon = weaponList[randomInt( weaponList.size )];
self giveWeapon( weapon );
self switchToWeapon( weapon );
}
RE: Same random weapon to all? - iBanana - 08-24-2011 Check the Sharpshooter's code?
RE: Same random weapon to all? - GoldenWrapper - 08-24-2011 (08-24-2011, 02:53)iBanana Wrote: Check the Sharpshooter's code? lol where would that be located?
RE: Same random weapon to all? - iBanana - 08-24-2011 (08-24-2011, 03:00)GoldenWrapper Wrote:(08-24-2011, 02:53)iBanana Wrote: Check the Sharpshooter's code? Program Files\Steam\SteamApps\common\call of duty black ops\raw\maps\mp\gametypes\shrp.gsc
RE: Same random weapon to all? - GoldenWrapper - 08-24-2011 (08-24-2011, 03:02)iBanana Wrote:(08-24-2011, 03:00)GoldenWrapper Wrote:(08-24-2011, 02:53)iBanana Wrote: Check the Sharpshooter's code? Thanks, I'll look into it.
RE: Same random weapon to all? - iBanana - 08-24-2011 (08-24-2011, 03:03)GoldenWrapper Wrote:No Problem.(08-24-2011, 03:02)iBanana Wrote:(08-24-2011, 03:00)GoldenWrapper Wrote:(08-24-2011, 02:53)iBanana Wrote: Check the Sharpshooter's code? RE: Same random weapon to all? - iAegle - 08-24-2011 Code: init()
{
level thread onPlayerConnect();
level thread ChooseRandomWeapon();
}
ChooseRandomWeapon()
{
while( true )
{
weaponList = [];
weaponList[weaponList.size] = "SPAS_mp";
weaponList[weaponList.size] = "rottweil72_mp";
weaponList[weaponList.size] = "Ithaca_mp";
weaponList[weaponList.size] = "hs10_mp";
weapon = weaponList[ randomInt( weaponList.size ) ];
while( weapon == level.randomShotgun )
weapon = weaponList[ randomInt( weaponList.size ) ];
level.randomShotgun = weapon;
wait 30;
}
}
onPlayerConnect()
{
while( true )
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
OnPlayerSpawned()
{
self endon( "disconnect" );
while( true )
{
self waittill( "spawned_player" );
self takeAllWeapons();
self giveWeapon( level.randomShotgun );
self setSpawnWeapon( level.randomShotgun );
}
}try this it chooses a new shotgun every 30 seconds
RE: Same random weapon to all? - GoldenWrapper - 08-25-2011 (08-24-2011, 10:39)iAegle Wrote: This is what I'm looking for. Thanks both of you! (08-24-2011, 10:39)iAegle Wrote: When I do this, it just says, "Awaiting connection 1..." and never connects. Any help? RE: Same random weapon to all? - OrangePL - 08-25-2011 Add some waits at give weapon part RE: Same random weapon to all? - iAegle - 08-25-2011 (08-25-2011, 09:18)OrangePL Wrote: Add some waits at give weapon part not needed |