Primary/secondary weapon slots system
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Primary/secondary weapon slots system
How would I go about creating a weapon slot system like in most modern fps games, where the player can only hold two weapons, and when he goes to pick up a new weapon, if he only has one, it just adds the new one to his inventory, and if he already has two weapons, then it swaps his current weapon and the ground weapon?
- DusterdooSmock
- Posts: 170
- Joined: Thu Aug 19, 2010 9:58 pm
(on iphone)
i did this by adding new .float weapon2
in weaponswitch functioni have made similiar to this:
local float priweapon;
priweapon = self.weapon;
self.weapon = self.weapon2;
self.weapon = priweapon;
when you pick up weapon you have if statement:
if (self.weapon2)
{
self.weapon = pickupweapon;
}
else
{
self.weapon2 = self.weapon;
self.weapon = pickupweapon;
}
Thqts how in theory it works. Easy and small. But 100 % working and there is no 3 weapon glitches possible.
i did this by adding new .float weapon2
in weaponswitch functioni have made similiar to this:
local float priweapon;
priweapon = self.weapon;
self.weapon = self.weapon2;
self.weapon = priweapon;
when you pick up weapon you have if statement:
if (self.weapon2)
{
self.weapon = pickupweapon;
}
else
{
self.weapon2 = self.weapon;
self.weapon = pickupweapon;
}
Thqts how in theory it works. Easy and small. But 100 % working and there is no 3 weapon glitches possible.
- Jukki
- Posts: 214
- Joined: Wed Apr 07, 2010 4:59 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest