Answered Weapons Wheel ported from zm to mp

Status
Not open for further replies.

Xx-GIPPI-xX

Veteran
Messages
8
Reaction score
4
Points
553
I all CabConModding people
i have a trouble with this script!!!!!

Every time that inject on BO2 freeze opr not* show the weapons if inject correctly i not know where script is bad
If anyone have advice .........i appreciate iit

PHP:
pickRealWeapon()  
{ 
self endon("disconnect"); 
    
    
    self exitMenu(); 
     self freezeControls(true);    
    self iPrintln("Press [{+speed_throw}]/[{+attack}] To Scroll"); 
    self iPrintln("Press [{+reload}] To Select"); 
    self iPrintln("Press [{+melee}] To Exit"); 
    id = random(level.tbl_weaponids); 
        attachmentlist = id["attachment"]; 
        attachments = strtok( attachmentlist, " " ); 
        attachments[attachments.size] = ""; 
        attachment = random(attachments); 
    basePoint = (self.origin); 
    randy = (id + attachment); 
    self setStance("stand"); 
    self setPlayerAngles((0, 180, 0)); 
    tehAngle = self.angles+(0, 90, 0); 
    weapon = []; 
    weapon[0] = spawnSM(basePoint+(0, 0, 75), getWeaponModel(randy[0]), tehAngle); 
    weapon[1] = spawnSM(basePoint+(0, 0, 60), getWeaponModel(randy[1]), tehAngle); 
    weapon[2] = spawnSM(basePoint+(0, 0, 40), getWeaponModel(randy[2]), tehAngle); 
    weapon[0] moveX(-70, 1, 1); 
    weapon[1] moveX(-70, 1, 1); 
    weapon[2] moveX(-70, 1, 1); 
    currentWeapon = []; 
    currentWeapon[0] = randy[0]; 
    currentWeapon[1] = randy[1]; 
    currentWeapon[2] = randy[2]; 
    wait 1; 
    for(;;) 
    { 
        if(self adsButtonPressed()) 
        { 
            for(m = 0; m < weapon.size; m++) 
                weapon[m] hide(); 
            thread createTempWeapon(weapon[0].origin, weapon[0].origin+(-50, 0, 0), weapon[0].model, tehAngle, .5, .25, .25); 
            thread createTempWeapon(weapon[1].origin, weapon[1].origin+(0, 0, 15), weapon[1].model, tehAngle, .5, .25, .25); 
            thread createTempWeapon(weapon[2].origin, weapon[2].origin+(0, 0, 20), weapon[2].model, tehAngle, .5, .25, .25); 
            for(;;) 
            { 
                newWeapon = (id + attachment); 
                if(newWeapon != currentWeapon[0] && newWeapon != currentWeapon[1] && newWeapon != currentWeapon[2]) 
                    break; 
                wait .05; 
            } 
            thread createTempWeapon(basePoint+(-70, 0, -5), basePoint+(-70, 0, 40), getWeaponModel(newWeapon), tehAngle, .5, .25, .25); 
            weapon[0] setModel(weapon[1].model); 
            weapon[1] setModel(weapon[2].model); 
            weapon[2] setModel(getWeaponModel(newWeapon)); 
            currentWeapon[0] = currentWeapon[1]; 
            currentWeapon[1] = currentWeapon[2]; 
            currentWeapon[2] = newWeapon; 
            wait .5; 
            for(m = 0; m < weapon.size; m++) 
                weapon[m] show(); 
        } 
        if(self attackButtonPressed()) 
        { 
            for(m = 0; m < weapon.size; m++) 
                weapon[m] hide(); 
            thread createTempWeapon(weapon[0].origin, weapon[0].origin+(0, 0, -15), weapon[0].model, tehAngle, .5, .25, .25); 
            thread createTempWeapon(weapon[1].origin, weapon[1].origin+(0, 0, -20), weapon[1].model, tehAngle, .5, .25, .25); 
            thread createTempWeapon(weapon[2].origin, weapon[2].origin+(-50, 0, 0), weapon[2].model, tehAngle, .5, .25, .25); 
            for(;;) 
            { 
                newWeapon = (id + attachment); 
                if(newWeapon != currentWeapon[0] && newWeapon != currentWeapon[1] && newWeapon != currentWeapon[2]) 
                    break; 
                wait .05; 
            } 
            thread createTempWeapon(basePoint+(-70, 0, 105), basePoint+(-70, 0, 75), getWeaponModel(newWeapon), tehAngle, .5, .25, .25); 
            weapon[2] setModel(weapon[1].model); 
            weapon[1] setModel(weapon[0].model); 
            weapon[0] setModel(getWeaponModel(newWeapon)); 
            currentWeapon[2] = currentWeapon[1]; 
            currentWeapon[1] = currentWeapon[0]; 
            currentWeapon[0] = newWeapon; 
            wait .5; 
            for(m = 0; m < weapon.size; m++) 
                weapon[m] show(); 
        } 
        if(self useButtonPressed()) 
        { 
            
            weapon[1] moveX(60, 1, 1); 
            wait 1; 
            for(m = 0; m < weapon.size; m++) 
                weapon[m] delete(); 
            sWeapon = currentWeapon[1]; 
            self giveTheWeapon(sWeapon); 
            break; 
        } 
        if(self meleeButtonPressed()) 
        { 
            weapon[0] moveTo(weapon[0].origin+(0,0,-70), .5, .25, .25); 
            weapon[1] moveTo(weapon[1].origin+(0,0,-70), .5, .25, .25); 
            weapon[2] moveTo(weapon[2].origin+(0,0,-70), .5, .25, .25); 
            wait .5; 
            for(m = 0; m < weapon.size; m++) 
                weapon[m] delete(); 
            break; 
        } 
        wait .01; 
    } 
    
    self freezeControls(false); 
    
} 

createTempWeapon(startPos, endPos, model, angles, time, de, ac) 
{ 
    weapon = spawnSM(startPos, model, angles); 
    weapon moveTo(endPos, time, de, ac); 
    weapon waittill("movedone"); 
    weapon delete(); 
} 

spawnSM(origin, model, angles) 
{ 

    ent = spawn("script_model", origin); 
    ent setModel(model); 
    if(isDefined(angles)) 
        ent.angles = angles; 
           return ent; 
}  



[LIST][*]Quick Reply[/LIST]
 

SCP

Moderator
Staff member
Donator
Messages
411
Reaction score
397
Points
848
I all CabConModding people
i have a trouble with this script!!!!!

Every time that inject on BO2 freeze opr not* show the weapons if inject correctly i not know where script is bad
If anyone have advice .........i appreciate iit

PHP:
pickRealWeapon() 
{
self endon("disconnect");
   
   
    self exitMenu();
     self freezeControls(true);   
    self iPrintln("Press [{+speed_throw}]/[{+attack}] To Scroll");
    self iPrintln("Press [{+reload}] To Select");
    self iPrintln("Press [{+melee}] To Exit");
    id = random(level.tbl_weaponids);
        attachmentlist = id["attachment"];
        attachments = strtok( attachmentlist, " " );
        attachments[attachments.size] = "";
        attachment = random(attachments);
    basePoint = (self.origin);
    randy = (id + attachment);
    self setStance("stand");
    self setPlayerAngles((0, 180, 0));
    tehAngle = self.angles+(0, 90, 0);
    weapon = [];
    weapon[0] = spawnSM(basePoint+(0, 0, 75), getWeaponModel(randy[0]), tehAngle);
    weapon[1] = spawnSM(basePoint+(0, 0, 60), getWeaponModel(randy[1]), tehAngle);
    weapon[2] = spawnSM(basePoint+(0, 0, 40), getWeaponModel(randy[2]), tehAngle);
    weapon[0] moveX(-70, 1, 1);
    weapon[1] moveX(-70, 1, 1);
    weapon[2] moveX(-70, 1, 1);
    currentWeapon = [];
    currentWeapon[0] = randy[0];
    currentWeapon[1] = randy[1];
    currentWeapon[2] = randy[2];
    wait 1;
    for(;;)
    {
        if(self adsButtonPressed())
        {
            for(m = 0; m < weapon.size; m++)
                weapon[m] hide();
            thread createTempWeapon(weapon[0].origin, weapon[0].origin+(-50, 0, 0), weapon[0].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[1].origin, weapon[1].origin+(0, 0, 15), weapon[1].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[2].origin, weapon[2].origin+(0, 0, 20), weapon[2].model, tehAngle, .5, .25, .25);
            for(;;)
            {
                newWeapon = (id + attachment);
                if(newWeapon != currentWeapon[0] && newWeapon != currentWeapon[1] && newWeapon != currentWeapon[2])
                    break;
                wait .05;
            }
            thread createTempWeapon(basePoint+(-70, 0, -5), basePoint+(-70, 0, 40), getWeaponModel(newWeapon), tehAngle, .5, .25, .25);
            weapon[0] setModel(weapon[1].model);
            weapon[1] setModel(weapon[2].model);
            weapon[2] setModel(getWeaponModel(newWeapon));
            currentWeapon[0] = currentWeapon[1];
            currentWeapon[1] = currentWeapon[2];
            currentWeapon[2] = newWeapon;
            wait .5;
            for(m = 0; m < weapon.size; m++)
                weapon[m] show();
        }
        if(self attackButtonPressed())
        {
            for(m = 0; m < weapon.size; m++)
                weapon[m] hide();
            thread createTempWeapon(weapon[0].origin, weapon[0].origin+(0, 0, -15), weapon[0].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[1].origin, weapon[1].origin+(0, 0, -20), weapon[1].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[2].origin, weapon[2].origin+(-50, 0, 0), weapon[2].model, tehAngle, .5, .25, .25);
            for(;;)
            {
                newWeapon = (id + attachment);
                if(newWeapon != currentWeapon[0] && newWeapon != currentWeapon[1] && newWeapon != currentWeapon[2])
                    break;
                wait .05;
            }
            thread createTempWeapon(basePoint+(-70, 0, 105), basePoint+(-70, 0, 75), getWeaponModel(newWeapon), tehAngle, .5, .25, .25);
            weapon[2] setModel(weapon[1].model);
            weapon[1] setModel(weapon[0].model);
            weapon[0] setModel(getWeaponModel(newWeapon));
            currentWeapon[2] = currentWeapon[1];
            currentWeapon[1] = currentWeapon[0];
            currentWeapon[0] = newWeapon;
            wait .5;
            for(m = 0; m < weapon.size; m++)
                weapon[m] show();
        }
        if(self useButtonPressed())
        {
           
            weapon[1] moveX(60, 1, 1);
            wait 1;
            for(m = 0; m < weapon.size; m++)
                weapon[m] delete();
            sWeapon = currentWeapon[1];
            self giveTheWeapon(sWeapon);
            break;
        }
        if(self meleeButtonPressed())
        {
            weapon[0] moveTo(weapon[0].origin+(0,0,-70), .5, .25, .25);
            weapon[1] moveTo(weapon[1].origin+(0,0,-70), .5, .25, .25);
            weapon[2] moveTo(weapon[2].origin+(0,0,-70), .5, .25, .25);
            wait .5;
            for(m = 0; m < weapon.size; m++)
                weapon[m] delete();
            break;
        }
        wait .01;
    }
   
    self freezeControls(false);
   
}

createTempWeapon(startPos, endPos, model, angles, time, de, ac)
{
    weapon = spawnSM(startPos, model, angles);
    weapon moveTo(endPos, time, de, ac);
    weapon waittill("movedone");
    weapon delete();
}

spawnSM(origin, model, angles)
{

    ent = spawn("script_model", origin);
    ent setModel(model);
    if(isDefined(angles))
        ent.angles = angles;
           return ent;
} 



[LIST][*]Quick Reply[/LIST]
Where did you find this function? Is it made for Black Ops 2?
 

Xx-GIPPI-xX

Veteran
Messages
8
Reaction score
4
Points
553
You can make this better and add Credits!
PHP:
pickRealWeapon()
{
self endon("disconnect");
   self exitMenu();
    self freezeControls(true);   
   self iPrintln("Press [{+speed_throw}]/[{+attack}] To Scroll");
   self iPrintln("Press [{+usereload}] To Select");
   self iPrintln("Press [{+melee}] To Exit");
   keys = level.rawRandomGunsArray;
   basePoint = (self.origin);
    randy =
    randy = (keys);
    self setStance("stand");
    self setPlayerAngles((0, 180, 0));
    tehAngle = self.angles+(0, 90, 0);
    weapon = [];
    weapon[0] = spawnSM(basePoint+(0, 0, 75), getWeaponModel(randy[0]), tehAngle);
    weapon[1] = spawnSM(basePoint+(0, 0, 60), getWeaponModel(randy[1]), tehAngle);
    weapon[2] = spawnSM(basePoint+(0, 0, 40), getWeaponModel(randy[2]), tehAngle);
    weapon[0] moveX(-70, 1, 1);
    weapon[1] moveX(-70, 1, 1);
    weapon[2] moveX(-70, 1, 1);
    currentWeapon = [];
    currentWeapon[0] = randy[0];
    currentWeapon[1] = randy[1];
    currentWeapon[2] = randy[2];
    wait 1;
    for(;;)
    {
        if(self adsButtonPressed())
        {
            for(m = 0; m < weapon.size; m++)
                weapon[m] hide();
            thread createTempWeapon(weapon[0].origin, weapon[0].origin+(-50, 0, 0), weapon[0].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[1].origin, weapon[1].origin+(0, 0, 15), weapon[1].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[2].origin, weapon[2].origin+(0, 0, 20), weapon[2].model, tehAngle, .5, .25, .25);
            for(;;)
            {
                newWeapon = keys[randomInt(keys.size)];
                if(newWeapon != currentWeapon[0] && newWeapon != currentWeapon[1] && newWeapon != currentWeapon[2])
                    break;
                wait .05;
            }
            thread createTempWeapon(basePoint+(-70, 0, -5), basePoint+(-70, 0, 40), getWeaponModel(newWeapon), tehAngle, .5, .25, .25);
            weapon[0] setModel(weapon[1].model);
            weapon[1] setModel(weapon[2].model);
            weapon[2] setModel(getWeaponModel(newWeapon));
            currentWeapon[0] = currentWeapon[1];
            currentWeapon[1] = currentWeapon[2];
            currentWeapon[2] = newWeapon;
            wait .5;
            for(m = 0; m < weapon.size; m++)
                weapon[m] show();
        }
        if(self attackButtonPressed())
        {
            for(m = 0; m < weapon.size; m++)
                weapon[m] hide();
            thread createTempWeapon(weapon[0].origin, weapon[0].origin+(0, 0, -15), weapon[0].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[1].origin, weapon[1].origin+(0, 0, -20), weapon[1].model, tehAngle, .5, .25, .25);
            thread createTempWeapon(weapon[2].origin, weapon[2].origin+(-50, 0, 0), weapon[2].model, tehAngle, .5, .25, .25);
            for(;;)
            {
                newWeapon = keys[randomInt(keys.size)];
                if(newWeapon != currentWeapon[0] && newWeapon != currentWeapon[1] && newWeapon != currentWeapon[2])
                    break;
                wait .05;
            }
            thread createTempWeapon(basePoint+(-70, 0, 105), basePoint+(-70, 0, 75), getWeaponModel(newWeapon), tehAngle, .5, .25, .25);
            weapon[2] setModel(weapon[1].model);
            weapon[1] setModel(weapon[0].model);
            weapon[0] setModel(getWeaponModel(newWeapon));
            currentWeapon[2] = currentWeapon[1];
            currentWeapon[1] = currentWeapon[0];
            currentWeapon[0] = newWeapon;
            wait .5;
            for(m = 0; m < weapon.size; m++)
                weapon[m] show();
        }
        if(self useButtonPressed())
        {
           
            weapon[1] moveX(60, 1, 1);
            wait 1;
            for(m = 0; m < weapon.size; m++)
               array_delete(weapon); //weapon[m] delete();
           sWeapon = currentWeapon[1];
           self doweapon(sWeapon);
            break;
        }
        if(self meleeButtonPressed())
        {
            weapon[0] moveTo(weapon[0].origin+(0,0,-70), .5, .25, .25);
            weapon[1] moveTo(weapon[1].origin+(0,0,-70), .5, .25, .25);
            weapon[2] moveTo(weapon[2].origin+(0,0,-70), .5, .25, .25);
            wait .5;
            for(m = 0; m < weapon.size; m++)
                array_delete(weapon);//weapon[m] delete();
            break;
        }
        wait .01;
    }
       self freezeControls(false);
}

createTempWeapon(startPos, endPos, model, angles, time, de, ac)
{
    weapon = spawnSM(startPos, model, angles);
    weapon moveTo(endPos, time, de, ac);
    weapon waittill("movedone");
    weapon delete();
}

spawnSM(origin, model, angles)
{

    ent = spawn("script_model", origin);
    ent setModel(model);
    if(isDefined(angles))
        ent.angles = angles;
           return ent;
}

// Add this in init() in your menu also can edit with your prefered weapons
level.rawRandomGunsArray = strTok("killstreak_remote_turret_mp;minigun_drop_mp;knife_held_mp;knife_ballistic_mp;minigun_wager_mp;saiga12_mp;beretta93r_mp;judge_mp;kard_mp;smaw_mp;usrpg_mp;fhj18_mp;m32_wager_mp;riotshield_mp;crossbow_mp;870mcs_mp;saiga12_mp;ksg_mp;srm1216_mp;mk48_mp;qbb95_mp;lsat_mp;hamr_mp;svu_mp;dsr50_mp;ballista_mp;as50_mp;fiveseven_mp;fnp45_mp;mp7_mp;pdw57_mp;vector_mp;insas_mp;qcw05_mp;evoskorpion_mp;peacekeeper_mp;tar21_mp;type95_mp;sig556_mp;sa58_mp;hk416_mp;scar_mp;saritch_mp;xm8_mp;an94_mp",";");

credits to mikeeey: for original weapon wheel from WAW
Loz for Black Ops 2 Zombie and help me for ported to mp
 
Status
Not open for further replies.
Top