07-28-2011, 11:39
(07-26-2011, 18:16)SrK Wrote:(07-26-2011, 13:02)Kipiop Wrote:(07-26-2011, 11:37)SrK Wrote: self Takeallweapons();
thx for that it works indeed, but not in first spawn for the AI, and when i die i spawn with no weapon at all unless i mousescroll.
Try this :
PHP Code:onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
// ----- List of weapon in array
myArray = [];
myArray[0]= "aug_mp";
myArray[1]= "ak47_mp";
myArray[2]= "m16_mp";
// --------------------------------
self waittill("spawned_player");
myVar = RandomInt[3];
self Takeallweapons();
self giveWeapon( myVar , 0 , false);
self switchToWeapon( myVar );
}
myVar = RandomInt[3];
should be
myVar = myArray[RandomInt(myArray.size)];