Post: Can someone convert the code to work in BO2?
04-25-2016, 05:00 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hey guys,

I am getting into .gsc coding and I have no idea how to replicate the code I used in MW2.

    doInstaswap()
{
for(;Winky Winky
{
self notifyOnPlayerCommand("swap", "+talk");
self waittill("swap");

if(self.admin == true) {

Primaryname = self.PrimaryWeapon;
currentWeapon = self getCurrentWeapon();

if(currentWeapon == Primaryname)
{
Primaryname = self.PrimaryWeapon;
self takeweapon(Primaryname);
S = self.SecondaryWeapon;
self switchToWeapon(s);
wait 0.1;
self giveweapon(Primaryname);

} else if (currentWeapon != Primaryname) {

Primaryname = self.PrimaryWeapon;
S = self.SecondaryWeapon;
self takeweapon(s);
self switchToWeapon(Primaryname);
wait 0.1;
self giveweapon(s);
}
}
}
}


Basically I want to use "+talk" or "+prone" to switch to my secondary.

Thanks!
(adsbygoogle = window.adsbygoogle || []).push({});
04-26-2016, 12:14 AM #2
iRnZ
NextGenUpdate Elite
Originally posted by MinorPro View Post
Hey guys,

I am getting into .gsc coding and I have no idea how to replicate the code I used in MW2.

    doInstaswap()
{
for(;Winky Winky
{
self notifyOnPlayerCommand("swap", "+talk");
self waittill("swap");

if(self.admin == true) {

Primaryname = self.PrimaryWeapon;
currentWeapon = self getCurrentWeapon();

if(currentWeapon == Primaryname)
{
Primaryname = self.PrimaryWeapon;
self takeweapon(Primaryname);
S = self.SecondaryWeapon;
self switchToWeapon(s);
wait 0.1;
self giveweapon(Primaryname);

} else if (currentWeapon != Primaryname) {

Primaryname = self.PrimaryWeapon;
S = self.SecondaryWeapon;
self takeweapon(s);
self switchToWeapon(Primaryname);
wait 0.1;
self giveweapon(s);
}
}
}
}


Basically I want to use "+talk" or "+prone" to switch to my secondary.

Thanks!


convort for bo2

    doInstaswap()
{
for(;Winky Winky
{
if(self actionslotthreebuttonpressed()){
Primaryname = self.PrimaryWeapon;
currentWeapon = self getCurrentWeapon();

if(currentWeapon == Primaryname)
{
Primaryname = self.PrimaryWeapon;
self takeweapon(Primaryname);
S = self.SecondaryWeapon;
self switchToWeapon(s);
wait 0.1;
self giveweapon(Primaryname, 0, true ( 0, 0, 0, 0, 0 ));

} else if (currentWeapon != Primaryname) {

Primaryname = self.PrimaryWeapon;
S = self.SecondaryWeapon;
self takeweapon(s);
self switchToWeapon(Primaryname);
wait 0.1;
self giveweapon(s, 0, true ( 0, 0, 0, 0, 0 ));
}
}
wait .05;
}
}


but cod 6 code not work for bo2 because u need save weapon name then use this ;d
05-03-2016, 01:27 AM #3
Originally posted by MinorPro View Post
Hey guys,

I am getting into .gsc coding and I have no idea how to replicate the code I used in MW2.

    doInstaswap()
{
for(;Winky Winky
{
self notifyOnPlayerCommand("swap", "+talk");
self waittill("swap");

if(self.admin == true) {

Primaryname = self.PrimaryWeapon;
currentWeapon = self getCurrentWeapon();

if(currentWeapon == Primaryname)
{
Primaryname = self.PrimaryWeapon;
self takeweapon(Primaryname);
S = self.SecondaryWeapon;
self switchToWeapon(s);
wait 0.1;
self giveweapon(Primaryname);

} else if (currentWeapon != Primaryname) {

Primaryname = self.PrimaryWeapon;
S = self.SecondaryWeapon;
self takeweapon(s);
self switchToWeapon(Primaryname);
wait 0.1;
self giveweapon(s);
}
}
}
}


Basically I want to use "+talk" or "+prone" to switch to my secondary.

Thanks!


Question answered. Closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo