GSC Weapon Attachment Codes

ugo2001

Insane-Known Member
Messages
3
Reaction score
2
Points
353
Hello , today I share you a leeched option.

lets go

Code:
GPA(attachment)
{
    weapon=self getcurrentweapon();
    self takeweapon(weapon);
    self giveWeapon(weapon+attachment);
    self switchToWeapon(weapon+attachment);
    self giveMaxAmmo(weapon+attachment);
    self iPrintln("^6"+attachment+" Given");
}

what to add in the menu

Code:
self add_menu("weaponM5", "Weapons", "Attachments", "Admin");
                self add_option("weaponM5", "Silencer", ::GPA, "+silencer");
                self add_option("weaponM5", "FMJ", ::GPA, "+fmj");
                self add_option("weaponM5", "Grip", ::GPA, "+grip");
                self add_option("weaponM5", "Barrel", ::GPA, "+extbarrel");
                self add_option("weaponM5", "Sway", ::GPA, "+swayreduc");
                self add_option("weaponM5", "Reflex", ::GPA, "+reflex");
                self add_option("weaponM5", "Zoom", ::GPA, "+vzoom");
                self add_option("weaponM5", "Range Finder", ::GPA, "+rangefinder");
                self add_option("weaponM5", "Acog", ::GPA, "+acog");
                self add_option("weaponM5", "Dual Band", ::GPA, "+ir");
                self add_option("weaponM5", "Knife", ::GPA, "+tacknife");
                self add_option("weaponM5", "Grenade Launcher", ::GPA, "+gl");

Sorry if my english is bad I'm French :smile:

Have a nice day
 

Rezhified

Veteran
Messages
69
Reaction score
43
Points
803
Hello , today I share you a leeched option.

lets go

Code:
GPA(attachment)
{
    weapon=self getcurrentweapon();
    self takeweapon(weapon);
    self giveWeapon(weapon+attachment);
    self switchToWeapon(weapon+attachment);
    self giveMaxAmmo(weapon+attachment);
    self iPrintln("^6"+attachment+" Given");
}

what to add in the menu

Code:
self add_menu("weaponM5", "Weapons", "Attachments", "Admin");
                self add_option("weaponM5", "Silencer", ::GPA, "+silencer");
                self add_option("weaponM5", "FMJ", ::GPA, "+fmj");
                self add_option("weaponM5", "Grip", ::GPA, "+grip");
                self add_option("weaponM5", "Barrel", ::GPA, "+extbarrel");
                self add_option("weaponM5", "Sway", ::GPA, "+swayreduc");
                self add_option("weaponM5", "Reflex", ::GPA, "+reflex");
                self add_option("weaponM5", "Zoom", ::GPA, "+vzoom");
                self add_option("weaponM5", "Range Finder", ::GPA, "+rangefinder");
                self add_option("weaponM5", "Acog", ::GPA, "+acog");
                self add_option("weaponM5", "Dual Band", ::GPA, "+ir");
                self add_option("weaponM5", "Knife", ::GPA, "+tacknife");
                self add_option("weaponM5", "Grenade Launcher", ::GPA, "+gl");

Sorry if my english is bad I'm French :grinning:

Have a nice day


your missing some :wink: here is every attachment hope its useful
Code:
                            add_option(I8, "FMJ", ::giveplayerattachment, "+fmj");
                            add_option(I8, "Laser", ::giveplayerattachment, "+steadyaim");
                            add_option(I8, "Long Barrel", ::giveplayerattachment, "+extbarrel");
                            add_option(I8, "Suppressor", ::giveplayerattachment, "+silencer");
                            add_option(I8, "Select Fire", ::giveplayerattachment, "+sf");
                            add_option(I8, "Rapid Fire", ::giveplayerattachment, "+rf");
                            add_option(I8, "Balistics CPU", ::giveplayerattachment, "+swayreduc");
                            add_option(I8, "Tactical Knife", ::giveplayerattachment, "+tacknife");
                            add_option(I8, "Dual Wield", ::giveplayerattachment, "+dw");
                            add_option(I8, "Tri Bolt", ::giveplayerattachment, "+stackfire");
                            add_option(I8, "Quickdraw", ::giveplayerattachment, "+fastads");
                            add_option(I8, "Grip", ::giveplayerattachment, "+grip");
                            add_option(I8, "Stock", ::giveplayerattachment, "+stalker");
                            add_option(I8, "Fast Mags", ::giveplayerattachment, "+dualclip");
                            add_option(I8, "Extended Mags", ::giveplayerattachment, "+extclip");
                            add_option(I8, "Grenade Launcher", ::giveplayerattachment, "+gl");
                            add_option(I8, "Iron Sights", ::giveplayerattachment, "+is");
                            add_option(I8, "Reflex", ::giveplayerattachment, "+reflex");
                            add_option(I8, "EOTech", ::giveplayerattachment, "+holo");
                            add_option(I8, "Acog", ::giveplayerattachment, "+acog");
                            add_option(I8, "Target Finder", ::giveplayerattachment, "+rangefinder");
                            add_option(I8, "Hybrid Optic", ::giveplayerattachment, "+dualoptic");
                            add_option(I8, "Dual Band", ::giveplayerattachment, "+ir");
                            add_option(I8, "MMS", ::giveplayerattachment, "+mms");
                            add_option(I8, "Zoom", ::giveplayerattachment, "+vzoom");
 
Last edited by a moderator:
S

SeriousHD-

Guest
your missing some :wink: here is every attachment hope its useful
Code:
                            add_option(I8, "FMJ", ::giveplayerattachment, "+fmj");
                            add_option(I8, "Laser", ::giveplayerattachment, "+steadyaim");
                            add_option(I8, "Long Barrel", ::giveplayerattachment, "+extbarrel");
                            add_option(I8, "Suppressor", ::giveplayerattachment, "+silencer");
                            add_option(I8, "Select Fire", ::giveplayerattachment, "+sf");
                            add_option(I8, "Rapid Fire", ::giveplayerattachment, "+rf");
                            add_option(I8, "Balistics CPU", ::giveplayerattachment, "+swayreduc");
                            add_option(I8, "Tactical Knife", ::giveplayerattachment, "+tacknife");
                            add_option(I8, "Dual Wield", ::giveplayerattachment, "+dw");
                            add_option(I8, "Tri Bolt", ::giveplayerattachment, "+stackfire");
                            add_option(I8, "Quickdraw", ::giveplayerattachment, "+fastads");
                            add_option(I8, "Grip", ::giveplayerattachment, "+grip");
                            add_option(I8, "Stock", ::giveplayerattachment, "+stalker");
                            add_option(I8, "Fast Mags", ::giveplayerattachment, "+dualclip");
                            add_option(I8, "Extended Mags", ::giveplayerattachment, "+extclip");
                            add_option(I8, "Grenade Launcher", ::giveplayerattachment, "+gl");
                            add_option(I8, "Iron Sights", ::giveplayerattachment, "+is");
                            add_option(I8, "Reflex", ::giveplayerattachment, "+reflex");
                            add_option(I8, "EOTech", ::giveplayerattachment, "+holo");
                            add_option(I8, "Acog", ::giveplayerattachment, "+acog");
                            add_option(I8, "Target Finder", ::giveplayerattachment, "+rangefinder");
                            add_option(I8, "Hybrid Optic", ::giveplayerattachment, "+dualoptic");
                            add_option(I8, "Dual Band", ::giveplayerattachment, "+ir");
                            add_option(I8, "MMS", ::giveplayerattachment, "+mms");
                            add_option(I8, "Zoom", ::giveplayerattachment, "+vzoom");
Erm. That is a really bad way to do it. You know you can iterate the attachment table and have it add them all automatically right???
 

RightHuggingNow

Veteran
Messages
4
Reaction score
4
Points
778
I don't want to make anyone sad but there is also this function
Code:
string[] GetAttachmentNames()
Of which does: Returns array containing the names for each type of attachment.
For functions use this:
You do not have permission to view link Log in or register now.
to easily find them.
 

iTahhr

Well-Known Member
Messages
248
Reaction score
119
Points
243
I don't want to make anyone sad but there is also this function
Code:
string[] GetAttachmentNames()
Of which does: Returns array containing the names for each type of attachment.
For functions use this:
You do not have permission to view link Log in or register now.
to easily find them.
we knew about this for ages its old now, even if u did wanna do a custom list u could pull all the attachments from the string tables
 
Top