ItsMods

Full Version: Random classes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(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 giveWeaponmyVar false);
            
self switchToWeaponmyVar );


myVar = RandomInt[3];

should be

myVar = myArray[RandomInt(myArray.size)];
Pages: 1 2